Subject: Re: High resolution clock
From: [email-masked] (Vladimir belkin)

26 Jul 1997 01:38:06 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <3.0.1.32.19970726104930.00923740.cygnus.gnu-win32@localhost>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Sender: belkin@localhost
X-Mailer: Windows Eudora Light Version 3.0.1 (32)
Original-To: [email-masked]
Original-Cc: [email-masked]
In-Reply-To: <Pine.SOL.3.96.970725211029.26675C-100000@jade1>
Original-Sender: [email-masked]

At 21:22 25.07.97 -0400, Joerg Lepler <[email-masked]> 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 ([email-masked])
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".