Improved the timer code.