Use the Timer class instead of the low level stuff