A high-resolution timer class. More...
#include <Timer.h>
Public Member Functions | |
Timer () | |
Constructs a default timer which is initialized as stopped. | |
Timer (bool startOnConstruction) | |
Constructs a default timer which is initialized as running unless startOnConstruction is false. | |
void | start () |
Begins timing. | |
double | getSeconds () const |
Returns the elapsed seconds if the timer is running, or the total time between calls to start() and stop() if it is stopped. | |
void | stop () |
Ends timing. | |
bool | isStopped () const |
Returns whether the timer is currently running. |
A high-resolution timer class.
cinder::Timer::Timer | ( | ) |
Constructs a default timer which is initialized as stopped.
cinder::Timer::Timer | ( | bool | startOnConstruction | ) |
Constructs a default timer which is initialized as running unless startOnConstruction is false.
void cinder::Timer::start | ( | ) |
Begins timing.
double cinder::Timer::getSeconds | ( | ) | const |
void cinder::Timer::stop | ( | ) |
Ends timing.
bool cinder::Timer::isStopped | ( | ) | const |
Returns whether the timer is currently running.