This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: High resolution clock
- To: joerg at std dot saic dot com (Joerg Lepler)
- Subject: Re: High resolution clock
- From: root at jacob dot remcomp dot fr (root)
- Date: Sat, 26 Jul 1997 09:29:08 +0200 (MET DST)
- Cc: gnu-win32 at cygnus dot com
>
> 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".