Regardless of the platform what you are asking for is how to raise and handle events. The sleep()/Sleep() functions will not work for you. This suspends your application and minus your application checking the time constantly you'll never know when 10 seconds pass. And this breaks your requirements you initially stated. You'd think the application has ADD if it kept asking "what time is it" over and over again.
If your target platform is Windows you can search "raise and handle events" for either C++ or .NET. The solutions are threaded, but it's minor threading, not much to handle. Threading isn't so bad. I don't recall but on .NET it's as simple as System.Threading.Thread.Sleep() and then you tell it what method to call when the thread wakes up. I'm a bit fuzzy, I'm mainly a UNIX developer. If your target platform is UNIX like, then use the alarm() function and have a SIGALRM handler. Searching for more info or doing a man page on alarm() will help you. -- Chris On Sun, 2008-01-06 at 15:42 +0530, Gopi Krishna Komanduri wrote: > Hi Frnds, > I strucked up with some very basic and simple prog . Could anyone of > you please help me out. I need to write a code in such a way that , > The code should call a function which prints some random number for > every 10 seconds . The issue what I am facing is once the control; > goes into function , initially I can get the starting time . But I am > unable to solve how my system will lemme know after 10 seconds. I > don't want to implement threads concept. I don't want to ping time for > every moment ( for optimisation purpose) . > > Why delete messages? Unlimited storage is just a click away. Go to > http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html > > [Non-text portions of this message have been removed] > > > > >
