Platform independent milli/micro/nanosecond timerThis class implements a simple cross-platform timer with nanosecond resolution. It operates similarly to a good stop watch: it can be started and stopped and records both the time since the last start() invocation, and the total time collected in separate intervals.
More...
#include <mitsuba/core/timer.h>
Platform independent milli/micro/nanosecond timer
This class implements a simple cross-platform timer with nanosecond resolution. It operates similarly to a good stop watch: it can be started and stopped and records both the time since the last start() invocation, and the total time collected in separate intervals.
- Author
- Edgar Velazquez-Armendariz
mitsuba::Timer::Timer |
( |
bool |
start = true | ) |
|
Create a new timer and start it unless the optional start
argument is set to false
.
virtual mitsuba::Timer::~Timer |
( |
| ) |
|
|
protectedvirtual |
virtual const Class* mitsuba::Timer::getClass |
( |
| ) |
const |
|
virtual |
Retrieve this object's class.
Reimplemented from Object.
unsigned int mitsuba::Timer::getMicroseconds |
( |
| ) |
const |
Return the number of microseconds that the timer has ticked so far (in total)
unsigned int mitsuba::Timer::getMicrosecondsSinceStart |
( |
| ) |
const |
Return the number of microseconds that have elapsed since the last start() invocation.
unsigned int mitsuba::Timer::getMilliseconds |
( |
| ) |
const |
Return the number of milliseconds that the timer has ticked so far (in total)
unsigned int mitsuba::Timer::getMillisecondsSinceStart |
( |
| ) |
const |
Return the number of milliseconds that have elapsed since the last start() invocation.
uint64_t mitsuba::Timer::getNanoseconds |
( |
| ) |
const |
Return the number of nanoseconds that the timer has ticked so far (in total)
uint64_t mitsuba::Timer::getNanosecondsSinceStart |
( |
| ) |
const |
Return the number of nanoseconds that have elapsed since the start() invocation.
Float mitsuba::Timer::getSeconds |
( |
| ) |
const |
Return the number of seconds that the timer has ticked so far (in total)
Float mitsuba::Timer::getSecondsSinceStart |
( |
| ) |
const |
Return the number of seconds that have elapsed since the last start() invocation.
Float mitsuba::Timer::lap |
( |
| ) |
|
"Lap"-style interface
This function is the atomic equivalent to stopping the timer, recording the time passed since it was started, and restarting it. The resulting time value in seconds is returned.
void mitsuba::Timer::reset |
( |
bool |
restart = true | ) |
|
Reset the timer, including the total elapsed time across all intervals (and restart it by default)
void mitsuba::Timer::start |
( |
| ) |
|
Float mitsuba::Timer::stop |
( |
| ) |
|
Stop the timer and return the total elapsed time across all intervals in seconds.
double mitsuba::Timer::timeSinceStart |
( |
| ) |
const |
|
protected |
Return the time in nanoseconds since the last start() invocation.
std::string mitsuba::Timer::toString |
( |
| ) |
const |
|
virtual |
Return a string representation.
Reimplemented from Object.
Class* mitsuba::Timer::m_theClass |
|
static |
The documentation for this class was generated from the following file: