fixed a bug in wxStopWatch::Pause() (wouldn't pause if called immediately after Start()) and changed Pause()/Resume() calls to nest
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,6 +26,8 @@ wxBase:
|
||||
documentation for details and revise your code accordingly: this change was
|
||||
unfortunately needed as the old class didn't behave correctly in all cases
|
||||
|
||||
- small change to wxStopWatch::Pause() semantics, please see the documentation
|
||||
|
||||
All (GUI):
|
||||
|
||||
- the event type constants are not constants any more but are dynamically
|
||||
|
@@ -1,6 +1,19 @@
|
||||
\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}
|
||||
|
||||
@@ -25,17 +38,22 @@ 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}
|
||||
|
||||
|
Reference in New Issue
Block a user