From: "Damian Yerrick" Newsgroups: comp.os.msdos.djgpp Subject: Re: usleep/delay/sleep ? Date: Sun, 15 Aug 1999 21:05:55 -0500 Organization: Rose-Hulman Institute of Technology Lines: 41 Message-ID: <7p7rn5$aii$1@solomon.cs.rose-hulman.edu> References: <934647567 DOT 25013 DOT 0 DOT nnrp-11 DOT c2de6b60 AT news DOT demon DOT co DOT uk> <37B64F8D DOT EED7B6CF AT tfz DOT net> NNTP-Posting-Host: 137.112.204.250 X-Trace: solomon.cs.rose-hulman.edu 934769189 10834 137.112.204.250 (16 Aug 1999 02:06:29 GMT) X-Complaints-To: news AT cs DOT rose-hulman DOT edu NNTP-Posting-Date: 16 Aug 1999 02:06:29 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com /* Simon, you could also do this: If you are not using Allegro, you can delay for 10 milliseconds by */ delay(10); /* If you are using Allegro's timer handler, you should use */ rest(10); /* To maintain compatibility with Windows's DOS box implementation, Allegro's timer handler rounds all times to the nearest 5 ms. Groman wrote in message news:37B64F8D DOT EED7B6CF AT tfz DOT net... > to achieve best results, program the timers yourself in assembly Or let Shawn write your assembly for you. Get Allegro; it'll simplify timer handling quite a bit. http://www.talula.demon.co.uk/allegro/ > > Simon Redwood wrote: > > > I am new to using djgpp under dos, being a unix programmer. I am having > > trouble with delays. > > > > Can I rely on usleep to give me accurate timings. > > > > Giving usleep a value of 10000-12500 produces the same delay, whereas 13000 > > gives the same as 20000, where I am going wrong. > > > > I would like to put a delay into a loop of about 1/100 sec. how is the best > > way to acheive this > > > > I am also looking to work with microprocessors where I will need accurate > > timings of nanoseconds, how can this be best acheived. > > > > TIA > > > > Simon */