Make start_timer() and stop_timer() robust against incorrect usage.