Timer for measuring small intervals, such as the duration of a
subroutine or other reasonably small period.
StopWatchelapsed;
elapsed.start;
// do something// ...doublei = elapsed.stop;
The measured interval is in units of seconds, using floating-
point to represent fractions. This approach is more flexible
than integer arithmetic since it migrates trivially to more
capable timer hardware (there no implicit granularity to the
measurable intervals, except the limits of fp representation)
StopWatch is accurate to the extent of what the underlying OS
supports. On linux systems, this accuracy is typically 1 us at
best. Win32 is generally more precise.
There is some minor overhead in using StopWatch, so take that into
account
Timer for measuring small intervals, such as the duration of a subroutine or other reasonably small period.
The measured interval is in units of seconds, using floating- point to represent fractions. This approach is more flexible than integer arithmetic since it migrates trivially to more capable timer hardware (there no implicit granularity to the measurable intervals, except the limits of fp representation)
StopWatch is accurate to the extent of what the underlying OS supports. On linux systems, this accuracy is typically 1 us at best. Win32 is generally more precise.
There is some minor overhead in using StopWatch, so take that into account