2000-03-17 09:19:37 +00:00
|
|
|
\section{\class{wxStopWatch}}\label{wxstopwatch}
|
|
|
|
|
2002-04-09 10:35:35 +00:00
|
|
|
The wxStopWatch class allow you to measure time intervals. For example, you may
|
|
|
|
use it to measure the time elapsed by some function:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
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());
|
|
|
|
\end{verbatim}
|
2000-03-17 09:19:37 +00:00
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/timer.h>
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{::wxStartTimer}{wxstarttimer}, \helpref{::wxGetElapsedTime}{wxgetelapsedtime}, \helpref{wxTimer}{wxtimer}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-22 10:59:57 +00:00
|
|
|
\membersection{wxStopWatch::wxStopWatch}\label{wxstopwatchctor}
|
2000-03-17 09:19:37 +00:00
|
|
|
|
|
|
|
\func{}{wxStopWatch}{\void}
|
|
|
|
|
|
|
|
Constructor. This starts the stop watch.
|
|
|
|
|
|
|
|
\membersection{wxStopWatch::Pause}\label{wxstopwatchpause}
|
|
|
|
|
|
|
|
\func{void}{Pause}{\void}
|
|
|
|
|
|
|
|
Pauses the stop watch. Call \helpref{wxStopWatch::Resume}{wxstopwatchresume} to resume
|
|
|
|
time measuring again.
|
|
|
|
|
2002-04-09 10:35:35 +00:00
|
|
|
If this method is called several times, {\tt Resume()} must be called the same
|
|
|
|
number of times to really resume the stop watch. You may, however, call
|
|
|
|
\helpref{Start}{wxstopwatchstart} to resume it unconditionally.
|
2000-03-17 09:19:37 +00:00
|
|
|
|
|
|
|
\membersection{wxStopWatch::Resume}\label{wxstopwatchresume}
|
|
|
|
|
|
|
|
\func{void}{Resume}{\void}
|
|
|
|
|
2002-04-09 10:35:35 +00:00
|
|
|
Resumes the stop watch which had been paused with
|
|
|
|
\helpref{wxStopWatch::Pause}{wxstopwatchpause}.
|
|
|
|
|
|
|
|
\membersection{wxStopWatch::Start}\label{wxstopwatchstart}
|
|
|
|
|
|
|
|
\func{void}{Start}{\param{long}{ milliseconds = 0}}
|
|
|
|
|
|
|
|
(Re)starts the stop watch with a given initial value.
|
2000-03-17 09:19:37 +00:00
|
|
|
|
2004-09-22 10:59:57 +00:00
|
|
|
\membersection{wxStopWatch::Time}\label{wxstopwatchtime}
|
2000-03-17 09:19:37 +00:00
|
|
|
|
2003-02-09 21:26:22 +00:00
|
|
|
\constfunc{long}{Time}{\void}\label{wxstopwatchtime}
|
2000-03-17 09:19:37 +00:00
|
|
|
|
|
|
|
Returns the time in milliseconds since the start (or restart) or the last call of
|
|
|
|
\helpref{wxStopWatch::Pause}{wxstopwatchpause}.
|
|
|
|
|