Cinder  0.9.1
Public Member Functions | List of all members
cinder::Timer Class Reference

#include <Timer.h>

Public Member Functions

 Timer ()
 
 Timer (bool startOnConstruction)
 
void start (double offsetSeconds=0)
 
double getSeconds () const
 
void stop ()
 
void resume ()
 
bool isStopped () const
 

Detailed Description

A high-resolution timer class.

Constructor & Destructor Documentation

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.

Member Function Documentation

void cinder::Timer::start ( double  offsetSeconds = 0)

Begins timing. Optional offsetSeconds parameter allows a relative offset.

double cinder::Timer::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 cinder::Timer::stop ( )

Ends timing.

void cinder::Timer::resume ( )

Resumes timing without resetting the timer.

bool cinder::Timer::isStopped ( ) const

Returns whether the timer is currently running.


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