delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/16/19:46:16

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
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019