21 StTimer::StTimer() : mStartTime(0), mStopTime(0), mIsStopped(1)
24 double StTimer::resolution()
const
26 return 1./double(CLOCKS_PER_SEC);
29 double StTimer::elapsedTime()
const
31 return (mIsStopped ? mStopTime : absoluteTime()) - mStartTime;
43 mStartTime = absoluteTime() - elapsedTime();
49 mStopTime = absoluteTime();
54 double StTimer::absoluteTime()
56 return (
double)clock()/CLOCKS_PER_SEC;