<s> import py <EOL> from pypy . translator . goal . timing import Timer <EOL> def test_timing ( ) : <EOL> t = Timer ( list ( reversed ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> ] ) ) . pop ) <EOL> t . start_event ( '<STR_LIT:x>' ) <EOL> t . end_event ( '<STR_LIT:x>' ) <EOL> t . start_event ( '<STR_LIT:y>' ) <EOL> t . end_event ( '<STR_LIT:y>' ) <EOL> py . test . raises ( AssertionError , "<STR_LIT>" ) <EOL> t . start_event ( '<STR_LIT:z>' ) <EOL> py . test . raises ( AssertionError , "<STR_LIT>" ) <EOL> t . end_event ( '<STR_LIT:z>' ) <EOL> assert t . events == [ ( '<STR_LIT:x>' , <NUM_LIT:1> ) , ( '<STR_LIT:y>' , <NUM_LIT:1> ) , ( '<STR_LIT:z>' , <NUM_LIT:1> ) ] <EOL> assert t . ttime ( ) == <NUM_LIT:5> </s>
