Cortex  10.0.0-a4
Public Member Functions | List of all members
IECore::Timer Class Reference

#include <Timer.h>

Public Member Functions

 Timer (bool start=true)
 
void start ()
 
double stop ()
 
bool running ()
 Returns true if the timer is running.
 
double currentElapsed () const
 
double totalElapsed () const
 

Detailed Description

A class useful for simple timing of operations. This simply wraps boost::timer with a more flexible interface that allows for starting and stopping while accumulating elapsed time. Time values returned are in seconds.

Constructor & Destructor Documentation

IECore::Timer::Timer ( bool  start = true)

Creates a new timer. If startAlready is true then calls start(), otherwise the timer is created stopped.

Member Function Documentation

double IECore::Timer::currentElapsed ( ) const

Returns the time elapsed since the last call to start(), or 0 if timer is not running.

void IECore::Timer::start ( )

Starts the timer. Throws an Exception if it's already running.

double IECore::Timer::stop ( )

Stops the timer. Throws an Exception if it's not running. Returns the time elapsed since the last call to start().

double IECore::Timer::totalElapsed ( ) const

Returns the total time this timer has been running for. This includes previous start()/stop() time periods and the current period if running() is true.


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