[computer-go] Precise clock cycles measurements

Mike Young mikewhy at sbcglobal.net
Sat Sep 2 21:41:15 PDT 2006


----- Original Message ----- 
From: "Lukasz Lew" <lukasz.lew at gmail.com>
To: "computer-go" <computer-go at computer-go.org>
Sent: Thursday, August 31, 2006 8:05 AM
Subject: [computer-go] Precise clock cycles measurements


> IMHO this is a way better than profiler.
> To measure clock cycles accurately of function call
> 
> play(color, move)
> 
> you may use
> 
> unsigned long cc_time;
> cc_time_of(cc_time, play(color, move));
> 
> Use this macro, (works for g++):
> [ Can someone port it to other compilers? ]

For VC7.x:

typedef TickCount unsigned __int64;

__forceinline 
TickCount GetPerfCount()
{    __asm rdtsc;
}

VC8 removed asm support for rdtsc.




More information about the computer-go mailing list