Photon Engine 2.0.0-beta
A physically based renderer.
|
A timer. Measures relative time (not wall clock). More...
#include <Timer.h>
Public Types | |
using | Clock = std::chrono::steady_clock |
using | DefaultTimeUnit = Clock::duration |
Public Member Functions | |
Timer () | |
Timer & | start () |
Zero and start the timer. | |
Timer & | accumulatedStart () |
Effectively resumes the timer. Start the timer by continuing last result from stop(). | |
Timer & | stop () |
Stop the timer and record elapsed time. | |
DefaultTimeUnit | markLap () |
Get the time elapsed between calls to markLap(). If this is the first markLap() call, start() and accumulatedStart() are treated as implicit lap marker. | |
DefaultTimeUnit | peekLap () const |
Get the time elapsed from last call to markLap(). Get the result of markLap() as if it was called, without actually making a lap mark– the state of the timer is not affected in anyway by this call. | |
DefaultTimeUnit | getDelta () const |
Get the time elapsed between start() and stop(). Possibly accumulated. Result may be accumulated if accumulatedStart() was used instead of start(). | |
template<typename NumberType = uint64> | |
NumberType | markLapS () |
Variants that return time in plain number with different units and types. As casting a numeric value across different types, these methods may induce precision loss depending on NumberType . Stick to base methods (the ones without time unit suffix) if numeric precision is important. | |
template<typename NumberType = uint64> | |
NumberType | markLapMs () |
template<typename NumberType = uint64> | |
NumberType | markLapUs () |
template<typename NumberType = uint64> | |
NumberType | markLapNs () |
template<typename NumberType = uint64> | |
NumberType | getDeltaS () const |
template<typename NumberType = uint64> | |
NumberType | getDeltaMs () const |
template<typename NumberType = uint64> | |
NumberType | getDeltaUs () const |
template<typename NumberType = uint64> | |
NumberType | getDeltaNs () const |
A timer. Measures relative time (not wall clock).
using ph::Timer::Clock = std::chrono::steady_clock |
using ph::Timer::DefaultTimeUnit = Clock::duration |
|
inline |
|
inline |
Effectively resumes the timer. Start the timer by continuing last result from stop().
|
inline |
Get the time elapsed between start() and stop(). Possibly accumulated. Result may be accumulated if accumulatedStart() was used instead of start().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the time elapsed between calls to markLap(). If this is the first markLap() call, start() and accumulatedStart() are treated as implicit lap marker.
|
inline |
|
inline |
|
inline |
Variants that return time in plain number with different units and types. As casting a numeric value across different types, these methods may induce precision loss depending on NumberType
. Stick to base methods (the ones without time unit suffix) if numeric precision is important.
|
inline |
|
inline |
|
inline |
Zero and start the timer.
|
inline |
Stop the timer and record elapsed time.