Class Timer

Timer class

Examples

Timer timer;
timer.start();

// code you want to time

timer.stop();
Float timeTaken = timer.getSeconds();

Constructors

Timer()

Initializes a new instance of the Timer class.

Declaration

Timer

Examples

Timer timer;
timer.start();

// code you want to time

timer.stop();
Float timeTaken = timer.getSeconds();

Methods

getHiResTimer()

Gets a high resolution timer in seconds.

Declaration

Float getHiResTimer()

Returns

Type Description
Float

getSeconds()

This function will return the number of seconds between start and stop.

Declaration

Float getSeconds()

Returns

Type Description
Float The number of seconds between start and stop.

getTimer()

Gets a timer value in seconds from the real time system clock. This is normally a low resolution timer.

Declaration

Float getTimer()

Returns

Type Description
Float

start()

This function will start the timer.

Declaration

Void start()

Returns

Type Description
Void

stop()

This function will stop the timer.

Declaration

Void stop()

Returns

Type Description
Void