from timer import Timer; with Timer() as t: blabla