]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/stopwtch.tex
added null pointer check and assert
[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 21
a7af285d
VZ
22\wxheading{Library}
23
24\helpref{wxBase}{librarieslist}
25
9c824f29
JS
26\wxheading{See also}
27
659f4d76 28\helpref{wxTimer}{wxtimer}
9c824f29
JS
29
30\latexignore{\rtfignore{\wxheading{Members}}}
31
15d83f72 32\membersection{wxStopWatch::wxStopWatch}\label{wxstopwatchctor}
9c824f29
JS
33
34\func{}{wxStopWatch}{\void}
35
36Constructor. This starts the stop watch.
37
38\membersection{wxStopWatch::Pause}\label{wxstopwatchpause}
39
40\func{void}{Pause}{\void}
41
42Pauses the stop watch. Call \helpref{wxStopWatch::Resume}{wxstopwatchresume} to resume
43time measuring again.
44
677eff07
VZ
45If this method is called several times, {\tt Resume()} must be called the same
46number of times to really resume the stop watch. You may, however, call
47\helpref{Start}{wxstopwatchstart} to resume it unconditionally.
9c824f29
JS
48
49\membersection{wxStopWatch::Resume}\label{wxstopwatchresume}
50
51\func{void}{Resume}{\void}
52
677eff07
VZ
53Resumes the stop watch which had been paused with
54\helpref{wxStopWatch::Pause}{wxstopwatchpause}.
55
56\membersection{wxStopWatch::Start}\label{wxstopwatchstart}
57
58\func{void}{Start}{\param{long}{ milliseconds = 0}}
59
60(Re)starts the stop watch with a given initial value.
9c824f29 61
15d83f72 62\membersection{wxStopWatch::Time}\label{wxstopwatchtime}
9c824f29 63
3e43d614 64\constfunc{long}{Time}{\void}\label{wxstopwatchtime}
9c824f29
JS
65
66Returns the time in milliseconds since the start (or restart) or the last call of
67\helpref{wxStopWatch::Pause}{wxstopwatchpause}.
68