The wxStopWatch class allow you to measure time intervals. For example, you may use it to measure the time elapsed by some function:
wxStopWatch sw; CallLongRunningFunction(); wxLogMessage("The long running function took %ldms to execute", sw.Time()); sw.Pause(); ... stopwatch is stopped now ... sw.Resume(); CallLongRunningFunction(); wxLogMessage("And calling it twice took $ldms in all", sw.Time());Include files
<wx/stopwatch.h>
See also
::wxStartTimer, ::wxGetElapsedTime, wxTimer
Members
wxStopWatch::wxStopWatch
wxStopWatch::Pause
wxStopWatch::Resume
wxStopWatch::Start
wxStopWatch::Time
wxStopWatch()
Constructor. This starts the stop watch.
void Pause()
Pauses the stop watch. Call wxStopWatch::Resume to resume time measuring again.
If this method is called several times, Resume() must be called the same number of times to really resume the stop watch. You may, however, call Start to resume it unconditionally.
void Resume()
Resumes the stop watch which had been paused with wxStopWatch::Pause.
void Start(long milliseconds = 0)
(Re)starts the stop watch with a given initial value.
long Time() const
Returns the time in milliseconds since the start (or restart) or the last call of wxStopWatch::Pause.