Revert "Modify the timer algorithm a bit."

This reverts commit e411a0ac4ea2c1e45b5dffc61f165ee527fd048f.

The new algorithm was buggy.