]>
git.saurik.com Git - wxWidgets.git/blob - interface/stopwatch.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxStopWatch
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @wxheader{stopwatch.h}
13 The wxStopWatch class allow you to measure time intervals. For example, you may
14 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
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
57 (Re)starts the stop watch with a given initial value.
59 void Start(long milliseconds
= 0);
62 Returns the time in milliseconds since the start (or restart) or the last call
71 // ============================================================================
72 // Global functions/macros
73 // ============================================================================
76 Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
80 long wxGetLocalTime();
83 Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
90 Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
92 @see wxDateTime::Now, wxLongLong
94 wxLongLong
wxGetLocalTimeMillis();