All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::Timer Class Reference

A timer. More...

#include <Radiant/Timer.hpp>

Public Member Functions

int resolution () const
 Get the timer resolution Returns the number of timer ticks per second. More...
 
void start ()
 Start the timer Starts the timer by resetting its clock to the current time.
 
double startTime () const
 Get start time Returns the time of the last start call. More...
 
double time () const
 Get elapsed time Returns the elapsed time in seconds since last start call. More...
 
 Timer ()
 Construct a new Timer and start it.
 

Detailed Description

A timer.

Timer is useful for measuring how long certain tasks take to complete. Typical usage is as follows:

// <Do something>
double elapsed = t.time();
See Also
Radiant::TimeStamp
Examples:
VirtualInputExample.cpp.

Member Function Documentation

int Radiant::Timer::resolution ( ) const
inline

Get the timer resolution Returns the number of timer ticks per second.

Returns
resolution in ticks per second
double Radiant::Timer::startTime ( ) const
inline

Get start time Returns the time of the last start call.

Returns
start time in seconds since unix epoch time.
double Radiant::Timer::time ( ) const
inline

Get elapsed time Returns the elapsed time in seconds since last start call.

Returns
elapsed time in seconds
Examples:
VirtualInputExample.cpp.