Computer Chess Club Archives


Search

Terms

Messages

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

Author: Mathieu Pagé

Date: 08:14:29 10/29/03

Go up one level in this thread


I use this little trick to handle time (under VC7) I think it is faster than any
other techniques (?) and that it can be adapted to other compiler:

__int64 TimeStamp()
{
   __asm
   {
      rdtsc
   }
   // warning c4035 normal, since implicitely returns edx:eax
}

the rdtsc command is an undocumentes one (i think) that return the number of cpu
cycle since the cpu was started. Of course you have to find how many cpu cycle
is there in one second, but this is an easy task.

If you want more explanation or more source code of my timer, just ask for it
here and I will give you more tonight.

Mathieu Pagé



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.