#include <wx/stopwatch.h>
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());
Public Member Functions | |
wxStopWatch () | |
Constructor. | |
void | Pause () |
Pauses the stop watch. | |
void | Resume () |
Resumes the stop watch which had been paused with 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 Pause(). |
wxStopWatch::wxStopWatch | ( | ) |
Constructor.
This starts the stop watch.
void wxStopWatch::Pause | ( | ) |
void wxStopWatch::Resume | ( | ) |
Resumes the stop watch which had been paused with Pause().
void wxStopWatch::Start | ( | long | milliseconds = 0 |
) |
(Re)starts the stop watch with a given initial value.
long wxStopWatch::Time | ( | ) | const |
Returns the time in milliseconds since the start (or restart) or the last call of Pause().
![]() |
[ top ] |