Subject: Re: High resolution clock
From: [email-masked] (root)

26 Jul 1997 01:17:26 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked] (Joerg Lepler)
Original-Cc: [email-masked]
In-Reply-To: <Pine.SOL.3.96.970725211029.26675C-100000@jade1> from "Joerg Lepler" at Jul 25, 97 09:22:39 pm
Original-Sender: [email-masked]

> 
>    Presently I am trying to do fine grain network performance measurments.
> Therefore I would need some functions for high resolution clocks. I
> remember that on a SUN or a SGI there were sw clocks with a resolution as
> low as 108 nanoseconds. As I have to deal with latencies of 2-3
> milliseconds, I need a clock with a resolution of at least one
> millisecond. 
> 
> Does anyone know about such clock functions for the win32 environment?
> 

If you are using a pentium, the best clock is the time stamp counter of the
CPU. This clock is incremented every clock cycle. If you are using a new
CPU at, say 200MHZ, you have a clock that is incremented 200 millions times
each second!

If you use the 'lcc-package', you can use the 'rdtsc' intrinsic that will
generate a floating point number containing the 64 bit rdtsc value. Under
GNU you will have to code that in assembler. I do not know for sure if the gnu
assembler supports rdtsc, but I believe it does.
	rdtsc leaves a 64 bit value in EAX EDX.
regards

-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".