On Wed, 7 Apr 2021 08:06:42 +0000 (UTC) 'Parduz' via wx-users wrote:
P> Hello, i asked these questions in the wxWidgets forum and they suggested
P> to write here, so here i am.
P>
P> 1) How can i know if a wxStopWatch is paused or running? I can't find
P> any method.
P> 2) Why m_elapsedBeforePause and m_pauseCount are all private with no
P> methods to access them)?
P> 3) Same question about GetClockFreq and GetCurrentClockValue?
The answer to all these questions is that wxStopWatch provides a
deliberately simple interface for the one simple thing that it does. The
only thing that I could consider adding would be IsPaused() but it's really
surprising that you need it because in typical use you do something like
void foo()
{
wxStopWatch sw;
... code you benchmark ...
sw.Pause();
... code you don't want to include in benchmark ...
sw.Resume();
... more code you benchmark ...
wxLogInfo("Benchmark took %ldms", sw.Time());
}
i.e. you know whether it's paused or not just from the structure of your
code.
If you use it for something more complicated than this, you probably
shouldn't, especially nowadays when you have C++11 chrono.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/