use vars '$start'; sub Start_timer : Test(startup) { $start = time; ... }; sub End_timer : Test(shutdown) { print time - $start; ... }