]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/stopwatch.h
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. For example, you may
13 use it to measure the time elapsed by some function:
17 CallLongRunningFunction();
18 wxLogMessage("The long running function took %ldms to execute",
21 ... stopwatch is stopped now ...
23 CallLongRunningFunction();
24 wxLogMessage("And calling it twice took $ldms in all", sw.Time());
36 Constructor. This starts the stop watch.
41 Pauses the stop watch. Call Resume() to resume
43 If this method is called several times, @c Resume() must be called the same
44 number of times to really resume the stop watch. You may, however, call
45 Start() to resume it unconditionally.
50 Resumes the stop watch which had been paused with
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 call
70 // ============================================================================
71 // Global functions/macros
72 // ============================================================================
74 /** @ingroup group_funcmacro_time */
78 Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
80 @see wxDateTime::Now()
82 @header{wx/stopwatch.h}
84 long wxGetLocalTime();
87 Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
89 @see wxDateTime::Now(), wxLongLong
91 @header{wx/stopwatch.h}
93 wxLongLong
wxGetLocalTimeMillis();
96 Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
98 @see wxDateTime::Now()
100 @header{wx/stopwatch.h}