Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!oberon!cit-vax!tybalt.caltech.edu!ssnyder From: ssnyder@tybalt.caltech.edu (Scott S. Snyder) Newsgroups: comp.sys.ibm.pc Subject: Re: Help with delay funct for MSC Message-ID: <4705@cit-vax.Caltech.Edu> Date: Sun, 29-Nov-87 19:23:10 EST Article-I.D.: cit-vax.4705 Posted: Sun Nov 29 19:23:10 1987 Date-Received: Wed, 2-Dec-87 21:44:32 EST References: <9394@shemp.UCLA.EDU> <2056@crash.cts.com> Sender: news@cit-vax.Caltech.Edu Reply-To: ssnyder@tybalt.caltech.edu.UUCP (Scott S. Snyder) Organization: California Institute of Technology Lines: 29 Keywords: sleep function, tic, DELAY routine for MS-C In article <9394@shemp.UCLA.EDU> claus@CS.UCLA.EDU () writes: >I am writing an application in MSC 4.0, and I wish to incorporate time >delays that are independed of the speed of the machine on which the >application is run. I couldn't find any appropriate routine in the >MSC documentation (yes I do have the manual). >Something like DELAY(x), where x is 1/18 seconds, would be ideal. > >I'm sure something like this exists, can anyone help? I usually use something like: #include#include sleep(secs) int secs; { time_t t, t0; t0 = time((time_t *)NULL); do { t = time((time_t *)NULL); } while (t - t0 < secs); } If more accuracy is required, ftime() can be used instead of time(). sss