AI for Games 1.1.1
Loading...
Searching...
No Matches
game2dai.utils.StopWatch Class Reference

Public Member Functions

 StopWatch ()
 
void reset ()
 
double getRunTime ()
 
double getElapsedTime ()
 

Private Attributes

long currTime
 
long lastTime
 
long lapTime
 
long startTime
 

Constructor & Destructor Documentation

◆ StopWatch()

game2dai.utils.StopWatch.StopWatch ( )

Create a stop watch and initialise it to the current time.

Member Function Documentation

◆ getElapsedTime()

double game2dai.utils.StopWatch.getElapsedTime ( )

Get the elapsed time since this method was called.
This should be called just ONCE at the beginning of the draw cycle

Returns
elapsed time in seconds.

◆ getRunTime()

double game2dai.utils.StopWatch.getRunTime ( )

Get the time since the stop watch was created or last reset.

Returns
run time in seconds

◆ reset()

void game2dai.utils.StopWatch.reset ( )

Initialise the stop-watch to the current time.


The documentation for this class was generated from the following file: