Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Convert time in seconds to hh::mm::ss

by Anonymous Monk
on Mar 16, 2016 at 14:50 UTC ( [id://1157942]=note: print w/replies, xml ) Need Help??


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); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1157942]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2026-04-10 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.