Re: clock_t clock(void);

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 02/24/04


Date: Tue, 24 Feb 2004 12:14:28 -0500

Depends on what you are trying to measure. If you are looking for times in minutes, it
probably is OK. Perhaps even tens of seconds. It measures wall-clock time, so if your app
blocks on, say, a network connection for 30 seconds, you measure a delay of 30 seconds.

Or you could use QueryPerformanceCounter. This will give accurate measurements to
milliseconds or better (its precision decreases on multiprocesosors). I don't recall if it
accounts for delays caused by blocks in the kernel.
                                        joe

On Tue, 24 Feb 2004 13:15:40 +0200, "Basil" <basil@petech.ac.za> wrote:

>Good day all.
>I'd like to measure the actual performance of various machines on certain
>routines. I'm using the clock(void) function. Is this an acceptable and
>accurate method? Is there any other method that would render better results?
>
>Thank you
>Basil
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm