Move time measurement into test cases