<?xml version="1.0" encoding="windows-1252"?>
<node id="783592" title="Re: Linux Process Start Time" created="2009-07-27 12:30:18" updated="2009-07-27 12:30:18">
<type id="11">
note</type>
<author id="195379">
idsfa</author>
<data>
<field name="doctext">
&lt;code&gt;
$ctime{$PID} = (stat "/proc/$PID/stat")[10];
&lt;/code&gt;

&lt;p&gt;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 &lt;c&gt;/proc&lt;/c&gt; if you wanted to port this anywhere else anyway ...&lt;/p&gt;

&lt;p&gt;(Yes, I know, it's technically the time since the file was last changed, but the &lt;c&gt;stat&lt;/c&gt; file is special that way.)&lt;/p&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-195379"&gt;
&lt;hr/&gt;
&lt;I&gt;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. &amp;mdash; Cyrus H. Gordon&lt;/I&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
783581</field>
<field name="parent_node">
783581</field>
</data>
</node>
