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); }
In reply to Re: Convert time in seconds to hh::mm::ss
by Anonymous Monk
in thread Convert time in seconds to hh::mm::ss
by bangor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |