]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/stopwtch.tex
another patch bring the docs more up to date (patch 1717776)
[wxWidgets.git] / docs / latex / wx / stopwtch.tex
CommitLineData
9c824f29
JS
1\section{\class{wxStopWatch}}\label{wxstopwatch}
2
677eff07
VZ
3The wxStopWatch class allow you to measure time intervals. For example, you may
4use it to measure the time elapsed by some function:
5
6\begin{verbatim}
7 wxStopWatch sw;
8 CallLongRunningFunction();
9 wxLogMessage("The long running function took %ldms to execute",
10 sw.Time());
11 sw.Pause();
12 ... stopwatch is stopped now ...
13 sw.Resume();
14 CallLongRunningFunction();
15 wxLogMessage("And calling it twice took $ldms in all", sw.Time());
16\end{verbatim}
9c824f29
JS
17
18\wxheading{Include files}
19
e4592d60 20<wx/stopwatch.h>
9c824f29
JS
21
22\wxheading{See also}
23
24\helpref{::wxStartTimer}{wxstarttimer}, \helpref{::wxGetElapsedTime}{wxgetelapsedtime}, \helpref{wxTimer}{wxtimer}
25
26\latexignore{\rtfignore{\wxheading{Members}}}
27
15d83f72 28\membersection{wxStopWatch::wxStopWatch}\label{wxstopwatchctor}
9c824f29
JS
29
30\func{}{wxStopWatch}{\void}
31
32Constructor. This starts the stop watch.
33
34\membersection{wxStopWatch::Pause}\label{wxstopwatchpause}
35
36\func{void}{Pause}{\void}
37
38Pauses the stop watch. Call \helpref{wxStopWatch::Resume}{wxstopwatchresume} to resume
39time measuring again.
40
677eff07
VZ
41If this method is called several times, {\tt Resume()} must be called the same
42number of times to really resume the stop watch. You may, however, call
43\helpref{Start}{wxstopwatchstart} to resume it unconditionally.
9c824f29
JS
44
45\membersection{wxStopWatch::Resume}\label{wxstopwatchresume}
46
47\func{void}{Resume}{\void}
48
677eff07
VZ
49Resumes the stop watch which had been paused with
50\helpref{wxStopWatch::Pause}{wxstopwatchpause}.
51
52\membersection{wxStopWatch::Start}\label{wxstopwatchstart}
53
54\func{void}{Start}{\param{long}{ milliseconds = 0}}
55
56(Re)starts the stop watch with a given initial value.
9c824f29 57
15d83f72 58\membersection{wxStopWatch::Time}\label{wxstopwatchtime}
9c824f29 59
3e43d614 60\constfunc{long}{Time}{\void}\label{wxstopwatchtime}
9c824f29
JS
61
62Returns the time in milliseconds since the start (or restart) or the last call of
63\helpref{wxStopWatch::Pause}{wxstopwatchpause}.
64