Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: converting 'ps' running times

by FreeBeerReekingMonk (Deacon)
on Jun 02, 2015 at 17:02 UTC ( [id://1128810]=note: print w/replies, xml ) Need Help??


in reply to Re^2: converting 'ps' running times
in thread converting 'ps' running times

I stand corrected! I did not do a benchmark test with exhaustive input...
and you came up with an even faster method to boot... chapeau!

edit, new version, 2% faster:

'newB' => sub { for my $time (@ps) { my @mult = (1, 60, 3600); my $age = $time =~ s/^(\d+)-// ? $1 * 86400 : 0; # ag +e in seconds $age += $_ * shift @mult for reverse split /:/, $time; } },

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-03-29 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found