]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/stopwatch.h
c99ffb0d1e1d0a40a1f5c4e29424cfeedec84334
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxStopWatch
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 The wxStopWatch class allow you to measure time intervals.
14 For example, you may use it to measure the time elapsed by some function:
18 CallLongRunningFunction();
19 wxLogMessage("The long running function took %ldms to execute",
22 ... stopwatch is stopped now ...
24 CallLongRunningFunction();
25 wxLogMessage("And calling it twice took $ldms in all", sw.Time());
37 Constructor. This starts the stop watch.
42 Pauses the stop watch. Call Resume() to resume time measuring again.
44 If this method is called several times, @c Resume() must be called the same
45 number of times to really resume the stop watch. You may, however, call
46 Start() to resume it unconditionally.
51 Resumes the stop watch which had been paused with Pause().
56 (Re)starts the stop watch with a given initial value.
58 void Start(long milliseconds
= 0);
61 Returns the time in milliseconds since the start (or restart) or the last
69 // ============================================================================
70 // Global functions/macros
71 // ============================================================================
73 /** @addtogroup group_funcmacro_time */
77 Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
79 @see wxDateTime::Now()
81 @header{wx/stopwatch.h}
83 long wxGetLocalTime();
86 Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
88 @see wxDateTime::Now(), wxLongLong
90 @header{wx/stopwatch.h}
92 wxLongLong
wxGetLocalTimeMillis();
95 Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
97 @see wxDateTime::Now()
99 @header{wx/stopwatch.h}