From: michael DOT mauch AT gmx DOT de (Michael Mauch) Newsgroups: comp.os.msdos.djgpp Subject: Re: A little problem with the assembler Date: Thu, 16 Oct 1997 13:57:22 +0200 Organization: Gerhard-Mercator-Universitaet -GH- Duisburg Lines: 19 Message-ID: <3447faef.5866138@news.uni-duisburg.de> References: <3445C093 DOT F9B18043 AT t2 DOT technion DOT ac DOT il> NNTP-Posting-Host: ppp100.uni-duisburg.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Thu, 16 Oct 1997 09:21:55 +0200, Genady Beryozkin 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