This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: High resolution clock


At 21:22 25.07.97 -0400, Joerg Lepler <joerg@std.saic.com> wrote:
>
>Hi,
>
>   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?

The best way is to use:

BOOL QueryPerformanceCounter( LARGE_INTEGER  *lpliPerformanceCount 
 // address of current counter value
);
  and 
BOOL QueryPerformanceFrequency(
   LARGE_INTEGER  *lpliPerformanceFreq 	// address of currentfrequency
);	

// When these functions does not work it is possible to use
// multimedia timer API (libwinmm.a) :

    MMRESULT timeBeginPeriod(UINT uPeriod); 
    DWORD timeGetTime(VOID);
    MMRESULT timeEndPeriod(UINT uPeriod);

//////////////////// ------- //////////////////


Regards,

  Vladimir Belkin (vladimir.belkin@usa.net)
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]