wx.StopWatch

Inheritance diagram for wx.StopWatch:



Description

The wx.StopWatch class allow you to measure time intervals. For example, you may use it to measure the time elapsed by some function:

sw = wx.StopWatch()

# Call some long running method...
CallLongRunningFunction()

print "The long running function took %ld ms to execute"%sw.Time()

sw.Pause()
# ... stopwatch is stopped now ...

sw.Resume()
CallLongRunningFunction()

print "And calling it twice took %ld ms in all"%sw.Time()

Methods Summary

Class API

Methods

__init__()
Constructor. This starts the stop watch.

Pause()

Pauses the stop watch. Call Resume to resume time measuring again.

If this method is called several times, Resume() must be called the same number of times to really resume the stop watch. You may, however, call Start to resume it unconditionally.


Resume()
Resumes the stop watch which had been paused with Pause.

Start(milliseconds=0)

(Re)starts the stop watch with a given initial value.

Parameters:

  • milliseconds (long)

Time()

Returns the time in milliseconds since the start (or restart) or the last call of Pause.


Returns:

long