public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Clouter <alex@digriz.org.uk>
To: linux-kernel@vger.kernel.org
Subject: Re: Measuring startup-time from userspace
Date: Mon, 3 Jan 2011 05:12:24 +0000	[thread overview]
Message-ID: <oe28v7-g0t.ln1@chipmunk.wormnet.eu> (raw)
In-Reply-To: 4D20FEF0.5020206@mozilla.com

Taras Glek <tglek@mozilla.com> wrote:
>
> Does Linux provide a reasonable way to measure how long a process has 
> existed for? The goal is to have a function that returns the number of 
> milliseconds since process-creation.
>
At a glance:
----
alex@berk:~$ stat /proc/16863/
  File: `/proc/16863/'
  Size: 0               Blocks: 0          IO Block: 1024   directory
Device: 3h/3d   Inode: 837808      Links: 6
Access: (0555/dr-xr-xr-x)  Uid: ( 1000/    alex)   Gid: ( 1000/    alex)
Access: 2011-01-03 05:07:47.888363341 +0000
Modify: 2011-01-03 05:07:47.888363341 +0000
Change: 2011-01-03 05:07:47.888363341 +0000
----

A nanosecond resolution timestamp for the moment when the pid is created 
it seems.  I could be completely wrong, but this seems to be one of 
those "too easy to be true" moments.

Cheers

-- 
Alexander Clouter
.sigmonster says: Marriage is the sole cause of divorce.


      parent reply	other threads:[~2011-01-03  5:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-02 22:40 Measuring startup-time from userspace Taras Glek
2011-01-03  1:29 ` Ben Gamari
2011-01-03  5:12 ` Alexander Clouter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=oe28v7-g0t.ln1@chipmunk.wormnet.eu \
    --to=alex@digriz.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox