$szTitle = "wxstopwatch"; include "./_header.inc"; ?>
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.
include "./_footer.inc"; ?>