Better timer implementation