home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!olivea!apple!apple!nuntius
- From: dwb@apple.com (David W. Berry)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: How do I sleep w/o using any CPU time
- Message-ID: <28474@goofy.Apple.COM>
- Date: 17 Jul 92 21:19:45 GMT
- References: <a684a397@spicewood.uucp>
- Sender: usenet@Apple.COM
- Organization: Greenwing Enterprises
- Lines: 15
- X-UserAgent: Nuntius v1.1
-
- In article <a684a397@spicewood.uucp>, you write:
- > I am writing an application to check something every so often. If
- > something exists, I will then put up an error window. Everything is
- Typed in off the type of my head, so this isn't error checked (or really
- even syntax checked) but it will give you the general idea...
-
- pascal void Delay(long ticks)
- {
- long wakeTime = TickCount() + ticks;
- long delay;
- EventRecord event;
-
- while((delay = (wakeTime - TickCount()) > 0)
- WaitNextEvent(0, &event, delay, 0);
- }
-