Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Time functions:

Author: Robert Hyatt

Date: 07:19:45 09/24/99

Go up one level in this thread


On September 24, 1999 at 07:50:47, GBes wrote:

>you can use clock( ) for this.
>
>clock_t start,finish;
>
>start = clock();
>// ...
>finish = clock();
>double difference = (double)(finish-start)/CLOCKS_PER_SECOND;


clock() is bad.  It returns processor time, and not wall-clock time.  If
something else runs with you, you will use more time than expected because
your cpu time doesn't increase linearly with elapsed time.

For unix, I use gettimeofday() which returns a very accurate wall-clock time
accurate to microseconds if you want...



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.