Added extra elaspedTime_*() methods to help with reporting times in milliseconds etc.

This commit is contained in:
Robert Osfield 2010-02-09 17:38:02 +00:00
parent 7103707815
commit be46c61eb1

View File

@ -102,11 +102,30 @@ class ElapsedTime
_startTick = _timer->tick();
}
/** elapsed time in seconds. */
inline double elapsedTime() const
{
return _timer->delta_s(_startTick, _timer->tick());
}
/** elapsed time in milliseconds. */
inline double elapsedTime_m() const
{
return _timer->delta_m(_startTick, _timer->tick());
}
/** elapsed time in microseconds. */
inline double elapsedTime_u() const
{
return _timer->delta_u(_startTick, _timer->tick());
}
/** elapsed time in nanoseconds. */
inline double elapsedTime_n() const
{
return _timer->delta_n(_startTick, _timer->tick());
}
inline void finish()
{
Timer_t endTick = _timer->tick();