Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Linux Process Start Time

by idsfa (Vicar)
on Jul 27, 2009 at 16:30 UTC ( #783592=note: print w/ replies, xml ) Need Help??


in reply to Linux Process Start Time

$ctime{$PID} = (stat "/proc/$PID/stat")[10];

This gives you the creation time of the process in seconds since the start of the epoch. While there can be concerns about portability across different OSes, you specified linux, and you wouldn't want to use /proc if you wanted to port this anywhere else anyway ...

(Yes, I know, it's technically the time since the file was last changed, but the stat file is special that way.)


The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon


Comment on Re: Linux Process Start Time
Select or Download Code
Re^2: Linux Process Start Time
by pileofrogs (Priest) on Jul 27, 2009 at 16:41 UTC

    ++

    Awesome! That's exactly what I was looking for!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (19)
As of 2014-10-21 17:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (106 votes), past polls