]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/stopwtch.tex
implemented wxNotificationMessage for wxMSW using wxTaskBarIcon and fallback to gener...
[wxWidgets.git] / docs / latex / wx / stopwtch.tex
index cff119d2cad11894ec3adb54d8e9afd555308743..1f756a493f58491981caffd0bfbd8b73973caecc 100644 (file)
@@ -1,18 +1,35 @@
 \section{\class{wxStopWatch}}\label{wxstopwatch}
 
-The wxStopWatch class allow you to measure time intervals.
+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}
 
 \wxheading{Include files}
 
-<wx/timer.h>
+<wx/stopwatch.h>
+
+\wxheading{Library}
+
+\helpref{wxBase}{librarieslist}
 
 \wxheading{See also}
 
-\helpref{::wxStartTimer}{wxstarttimer}, \helpref{::wxGetElapsedTime}{wxgetelapsedtime}, \helpref{wxTimer}{wxtimer}
+\helpref{wxTimer}{wxtimer}
 
 \latexignore{\rtfignore{\wxheading{Members}}}
 
-\membersection{wxStopWatch::wxStopWatch}
+\membersection{wxStopWatch::wxStopWatch}\label{wxstopwatchctor}
 
 \func{}{wxStopWatch}{\void}
 
@@ -25,21 +42,26 @@ Constructor. This starts the stop watch.
 Pauses the stop watch. Call \helpref{wxStopWatch::Resume}{wxstopwatchresume} to resume 
 time measuring again.
 
-\membersection{wxStopWatch::Start}
-
-\func{void}{Start}{\param{long}{ milliseconds = 0}}
-
-(Re)starts the stop watch with a given initial value.
+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.
 
 \membersection{wxStopWatch::Resume}\label{wxstopwatchresume}
 
 \func{void}{Resume}{\void}
 
-Resumes the stop watch after having been paused with \helpref{wxStopWatch::Pause}{wxstopwatchpause}.
+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.
 
-\membersection{wxStopWatch::Time}
+\membersection{wxStopWatch::Time}\label{wxstopwatchtime}
 
-\func{long}{Time}{\void}\label{wxstopwatchtime}
+\constfunc{long}{Time}{\void}\label{wxstopwatchtime}
 
 Returns the time in milliseconds since the start (or restart) or the last call of 
 \helpref{wxStopWatch::Pause}{wxstopwatchpause}.