This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: High resolution clock
- To: gnu-win32 at cygnus dot com
- Subject: Re: High resolution clock
- From: Vladimir belkin <belkin at minas dot rosmail dot com>
- Date: Sat, 26 Jul 1997 10:49:30 +0400
- Cc: joerg at std dot saic dot com
- References: <33d9fc6b.100425536@smtp.netzone.com>
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".