Belofte version 2.1.8
A promising chess program using the UCI or Winboard interface
TimedExecution Class Reference

Helper class for measuring execution time for functions Call ClockStart and ClockEnd at end of execution If getDuration is being called without ClockEnd, it will return elapsed time but continue counting. More...

#include <util.h>

+ Inheritance diagram for TimedExecution:

Public Member Functions

 TimedExecution ()
 implementation of timing functions
 
virtual ~TimedExecution ()=default
 
std::string getDuration () const
 
long long getDurationMicroSec () const
 

Protected Member Functions

void ClockStart ()
 
void ClockEnd ()
 
long long getDurationSec () const
 
long long getDurationMilliSec () const
 

Detailed Description

Helper class for measuring execution time for functions Call ClockStart and ClockEnd at end of execution If getDuration is being called without ClockEnd, it will return elapsed time but continue counting.

Definition at line 17 of file util.h.

Constructor & Destructor Documentation

◆ TimedExecution()

TimedExecution::TimedExecution ( )

implementation of timing functions

Definition at line 17 of file util.cpp.

+ Here is the call graph for this function:

◆ ~TimedExecution()

virtual TimedExecution::~TimedExecution ( )
virtualdefault

Member Function Documentation

◆ getDuration()

std::string TimedExecution::getDuration ( ) const

Definition at line 47 of file util.cpp.

Referenced by cmd_perft::execute(), and bSearchAlgorithm::SearchBestMove().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDurationMicroSec()

long long TimedExecution::getDurationMicroSec ( ) const

Definition at line 61 of file util.cpp.

Referenced by cmd_perft::execute(), getDuration(), and bel_debug::run_bench().

+ Here is the caller graph for this function:

◆ ClockStart()

void TimedExecution::ClockStart ( )
protected

Definition at line 27 of file util.cpp.

Referenced by bSearchAlgorithm::StartSearch(), and TimedExecution().

+ Here is the caller graph for this function:

◆ ClockEnd()

void TimedExecution::ClockEnd ( )
protected
Todo:
TOCHECK: for multi-threaded, make sure there is no race condition

Definition at line 37 of file util.cpp.

Referenced by bSearchAlgorithm::StopSearch().

+ Here is the caller graph for this function:

◆ getDurationSec()

long long TimedExecution::getDurationSec ( ) const
protected

Definition at line 105 of file util.cpp.

◆ getDurationMilliSec()

long long TimedExecution::getDurationMilliSec ( ) const
protected

Definition at line 83 of file util.cpp.

Referenced by bSearchAlgorithm::CheckIfAbortingSearch(), getDuration(), bSearchAlgorithm::sendInfoScore(), and bSearchAlgorithm::sendInfoSearching().

+ Here is the caller graph for this function: