implement a timer with python