From: root AT jacob DOT remcomp DOT fr (root) Subject: Re: High resolution clock 26 Jul 1997 01:17:26 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: Content-Type: text Original-To: joerg AT std DOT saic DOT com (Joerg Lepler) Original-Cc: gnu-win32 AT cygnus DOT com In-Reply-To: from "Joerg Lepler" at Jul 25, 97 09:22:39 pm Original-Sender: owner-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 AT cygnus DOT com" with one line of text: "help".