Howdy. Does anybody know how to get the uptime of a particular process? I'd imagine it's somewhere in /proc/<pid> but a lot of the files aren't too descriptive.
Justin
howto get the uptime of a process
Moderators: Developers, Moderators
-
- Posts: 7
- Joined: Sat Oct 19, 2002 5:16 pm
- Location: Paris, France
- Contact:
-
- Posts: 17
- Joined: Mon Oct 07, 2002 3:42 pm
Oh great thanks! I've played with this for the last day, and the ps output isn't really good for monitoring. It doesn't put placeholders for empty values.... for instance if a process has been running for 2 days, 3 hours, 6 minutes, and 12 seconds, it outputs something like:
02-03:06:12
but if the process has only been running for 10 minutes it only reports
10:00
That makes writing a script to parse the data a pain. I'm not sure if /proc/pid/stat actually holds the time. If it does I sure can't figure it out. Nothing in there resembles a unix timestamp (for a possible process-start time) and nothing increments every second. I'll keep playing with it tho....
Thanks again,
Justin
02-03:06:12
but if the process has only been running for 10 minutes it only reports
10:00
That makes writing a script to parse the data a pain. I'm not sure if /proc/pid/stat actually holds the time. If it does I sure can't figure it out. Nothing in there resembles a unix timestamp (for a possible process-start time) and nothing increments every second. I'll keep playing with it tho....
Thanks again,
Justin
Who is online
Users browsing this forum: No registered users and 2 guests