use vars '$start'; sub Start_timer : Test(startup) { my $start = time(); cprint "#\x037Started at ", (strftime '%A %d %B %Y %H:%M:%S',localtime($start)), "\x030\n"; } sub End_timer : Test(shutdown) { print time - $start; my $end = time; cprint "#\x037Ended at ", (strftime '%A %d %B %Y %H:%M:%S', localtime($end)),"\x030\n"; cprintf "#\x035 Total run time=>", $end-$start, " seconds\n"; cprintf ("%02d:%02d:%02d\x030\n",(gmtime($end-$start))[2,1,0]); } #### ok 243 - Logout ok Use of uninitialized value $MyTest::start in subtraction (-) at MyTest.pm line 402. 1463646157#Ended at jeudi 19 mai 2016 10:22:37 Use of uninitialized value $MyTest::start in subtraction (-) at MyTestingSuite.pm line 407. # Total run time=>Use of uninitialized value $MyTest::start in subtraction (-) at MyTest.pm line 408. 08:22:37