Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: clock() function in c++

Author: Vincent Diepeveen

Date: 18:03:51 10/28/03

Go up one level in this thread


On October 28, 2003 at 18:16:23, macaroni wrote:

don't use the clock function. i used it without problems in
DOS but later in my life, in world champs 1999 i was punished for that
bigtime (of course without me realizing it, had never looked again at the
code).

So diep had many problems world champs 1999 thanks to using the clock()
function which worked cool under DOS.

I use under windows now:
  GetTickCount()

And under linux i use gettimeofday()

>I have been using the clock() c++ function in my timeout function. However, I
>have noticed that occasionally my program doesn't think for nearly as long as it
>should, and moves even before it has a legal ply 1 move to play. I have narrowed
>it down to the timeout function, but can't understand why it doesn't work...does
>the clock() function ever 'turnover' and go back to 0, if so, how frequently?
>could this be the cause of the problem, and if so, what can I do about it?
>cheers



This page took 0.22 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.