From: belkin AT minas DOT rosmail DOT com (Vladimir belkin) Subject: Re: High resolution clock 26 Jul 1997 01:38:06 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <3.0.1.32.19970726104930.00923740.cygnus.gnu-win32@localhost> References: <33d9fc6b DOT 100425536 AT smtp DOT netzone DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Sender: belkin AT localhost X-Mailer: Windows Eudora Light Version 3.0.1 (32) Original-To: gnu-win32 AT cygnus DOT com Original-Cc: joerg AT std DOT saic DOT com In-Reply-To: Original-Sender: owner-gnu-win32 AT cygnus DOT com At 21:22 25.07.97 -0400, Joerg Lepler 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 DOT belkin AT usa DOT net) - 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".