Change timing middleware to use time.clock