use Tk; use Time::Duration; $start_time = time(); print "Start Time: $start_time\n"; $mw = MainWindow->new(); $timi = $mw->Label( -textvariable=>\$elapsed_time, -foreground=>'blue' )->pack; $mw->Button( -text=>'Quit', -command=>sub{ exit } )->pack; $mw->Button( -text=>'Update', -command=>sub{ print "New Time: $elapsed_time\n"; } )->pack; sub update_time {$elapsed_time = concise(duration_exact(time() - $start_time)); $timi->update();} $timi->repeat(50,\&update_time); MainLoop;