Per code review, factor out the timer interactions into a separate C++
class.  Switch the stopwatch to a double from an integer to prevent
overflows. #4594