9 #include "fwCore/HiResTimer.hpp" 14 HiResTimer::HiResTimer()
20 HiResTimer::~HiResTimer()
28 m_cumulTimeInMicroSec = m_endTimeInMicroSec - m_startTimeInMicroSec;
29 m_startTimeInMicroSec = ::fwCore::HiResClock::getTimeInMicroSec();
36 m_endTimeInMicroSec = ::fwCore::HiResClock::getTimeInMicroSec();
41 bool wasStopped = m_stopped;
46 m_startTimeInMicroSec = 0.;
47 m_endTimeInMicroSec = 0.;
48 m_cumulTimeInMicroSec = initial_value;
59 m_endTimeInMicroSec = ::fwCore::HiResClock::getTimeInMicroSec();
62 return m_cumulTimeInMicroSec + (m_endTimeInMicroSec - m_startTimeInMicroSec);
FWCORE_API void stop()
Stop the timer. stop() will not reset the timer.
This namespace fwCore provides common foundations for FW4SPL.
double HiResClockType
Type returned by HiResClock Functions.
FWCORE_API::fwCore::HiResClock::HiResClockType getElapsedTimeInMilliSec()
FWCORE_API void reset(::fwCore::HiResClock::HiResClockType initial_value=0.)
Reset the timer and leave it in the same state it was (started or stopped).
FWCORE_API void start()
Start the timer.
FWCORE_API::fwCore::HiResClock::HiResClockType getElapsedTimeInMicroSec()
FWCORE_API::fwCore::HiResClock::HiResClockType getElapsedTimeInSec()