High resolution clock

root root@jacob.remcomp.fr
Sat Jul 26 00:36:00 GMT 1997


> 
>    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
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list