in reply to Convert time in seconds to hh::mm::ss
Minor bump in speed can be obtained with use integer; Other than that, just keep your code as laconic as possible, avoiding temporary variables and statements:
sub parse_duration { use integer; sprintf("%02d:%02d:%02d", $_[0]/3600, $_[0]/60%60, $_[0]%60); }
|
|---|