Re: time waits
- Posted by Kat <gertie at PELL.NET> May 19, 2001
- 357 views
On 19 May 2001, at 17:07, Ted Fines wrote: > > sleep(nn) will do it. I've wondered just how much CPU time sleeping takes > up...Anyone know? Thanks, Ted, i dropped in sleep(10) and cpu useage dropped from 80% average to 1% on average! I *did* check the Eu help docs for time(r)-related words too, and they didn't come up with sleep(). Kat > Below is the description. Good luck! > --Ted > > sleep > Syntax: include misc.e > sleep(i) > Description: Suspend execution for i seconds. > Comments: On WIN32 and Linux, the operating system will suspend your > process and schedule other processes. On DOS32, your program will go into a > busy > loop for i seconds, during which time other processes may run, but they will > compete with your process for the CPU. Example: > puts(1, "Waiting 15 seconds...\n") > sleep(15) > puts(1, "Done.\n") > > > > --On Saturday, May 19, 2001 5:03 PM -0500 Kat <gertie at PELL.NET> wrote: > > > > > > > Hi all, > > In windoze, is it possible to do something other than this: > > > > time1 = time() > > --wait 60 seconds > > while time() < time1+60 do end while > > > > to pause 60 seconds? That code is actually using cpu cycles, and i'd > > prefer to: > > > > pause(60) > > > > and to not use the cpu, and have windoze wake up the program at the > > following line in 60 seconds. I looked in the archives for "pause", > > "wait", and "delay", but got no matches. Any thoughts? The only thing i > > can > > come up with is loop it thru mirc and use mirc's timers. Or is the answer > > buried somewhere in timer.exw? By the way, it says winmain takes two > > arguements, so i argued with it twice, but it won't stop saying that, no > > matter how much i argue at it. Must i use a winmain window if all i want is > > a > > timer? > > > > Kat > >