Mail Archives: djgpp/1997/10/16/19:46:16
On Thu, 16 Oct 1997 09:21:55 +0200, Genady Beryozkin
<c0467082 AT t2 DOT technion DOT ac DOT il> wrote:
> The module is intended to measure time with some super-high accuracy
> (of 1 nanosecond) and I desparately need it to work under djgpp.
There's no way to measure times with 1 nanosecond accuracy on a PC. Your
RAM chips have 60 or 70 ns access time, the L2-cache approximately 10
ns. A 200 MHz Pentium needs 1/(200e6 1/s)=5 ns for one CPU cycle, and
most CPU instructions take more than one cycle.
IMHO the best you can get is about 840 nanoseconds. Fortunately, DJGPP's
uclock() function has this accuracy, at least under plain DOS (no
Windows/Win95). If you need a function that works in Win3.1/Win95 DOS
boxes as well, please search the DJGPP mail archives at
http://www.delorie.com for "puclock".
Regards...
Michael
- Raw text -