Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Formatting elapsed time

by Hofmator (Curate)
on Sep 06, 2001 at 17:34 UTC ( #110568=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        $res .= sprintf "%dw", $weeks   if $weeks;
        $res .= sprintf "%dd", $days    if $days;
        $res .= sprintf "%dh", $hours   if $hours;
        $res .= sprintf "%dm", $minutes if $minutes;
        $res .= sprintf '%ds', $seconds;
    
  2. or download this
     $res .= sprintf "%dw", $weeks   if                                $we
    +eks;
     $res .= sprintf "%dd", $days    if                       $days or $we
    +eks;
     $res .= sprintf "%dh", $hours   if             $hours or $days or $we
    +eks;
     $res .= sprintf "%dm", $minutes if $minutes or $hours or $days or $we
    +eks;
     $res .= sprintf '%ds', $seconds;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-07-12 11:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (239 votes), past polls