Python timer implementation