Improvements to stopwatch implementation