Aded new convinience methods to osg::Timer - s/getStartTick and time_s(), time_m() etc

to help get time reletive the new start tick.
This commit is contained in:
Robert Osfield
2006-12-26 17:37:06 +00:00
parent 92291f29b7
commit 93dbfa04b7
2 changed files with 36 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ using namespace osg;
// all the rest of the timer methods are implemented within the header.
const Timer* Timer::instance()
Timer* Timer::instance()
{
static Timer s_timer;
return &s_timer;
@@ -51,6 +51,8 @@ const Timer* Timer::instance()
notify(NOTICE)<<"Error: Timer::Timer() unable to use QueryPerformanceFrequency, "<<std::endl;
notify(NOTICE)<<"timing code will be wrong, Windows error code: "<<GetLastError()<<std::endl;
}
setStartTick();
}
Timer_t Timer::tick() const
@@ -75,6 +77,8 @@ const Timer* Timer::instance()
Timer::Timer( void )
{
_secsPerTick = (1.0 / (double) 1000000);
setStartTick();
}
Timer_t Timer::tick() const