Search

For example, you may use it to measure the time elapsed by some function:

sw=wx.StopWatch()CallLongRunningFunction()wx.LogMessage("The long running function took %dms to execute",sw.Time())sw.Pause()# stopwatch is stopped now ...sw.Resume()CallLongRunningFunction()wx.LogMessage("And calling it twice took %dms in all",sw.Time())

Since wxWidgets 2.9.3 this class uses QueryPerformanceCounter() function under MSW to measure the elapsed time. It provides higher precision than the usual timer functions but can suffer from bugs in its implementation in some Windows XP versions. If you encounter such problems, installing a Microsoft hot fix from http://support.microsoft.com/?id=896256 could be necessary.