LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-15-2010, 07:18 AM   #1
cypkw
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 0
How to calculate the length of process's life in Linux?


Hi everybody.
I would like to ask you some questions about the length of process's life.
Each process has its life length.From its being created to end.
The length of each process's life may not be different.
If i want to calculate the process's life length in linux,what should i do?
please give me some advices.
thank you for your reading.
 
Old 11-15-2010, 10:06 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
You need to know specifically which process you want to analyze. For example the init process runs the entire time that Linux is running. On the other hand when you execute a command Linux spawns child a process that only lasts as long as it takes to finish executing the command.

If you want to analyze processes at random then you can enable Linux process accounting. That will keep details about all of the processes that run on the computer. You can then analyze any process that has already run.

Last edited by stress_junkie; 11-15-2010 at 10:09 AM.
 
Old 11-15-2010, 12:46 PM   #3
psisquare
Member
 
Registered: Sep 2004
Location: Germany
Distribution: Gentoo
Posts: 164

Rep: Reputation: 31
Maybe you're searching for time(1) (try "man 1 time")?

Code:
$ time ping -c1 linuxquestions.org > /dev/null

real    0m0.493s
user    0m0.000s
sys     0m0.007s
 
1 members found this post helpful.
Old 11-17-2010, 12:26 AM   #4
ravi.xolve
Member
 
Registered: Jul 2006
Posts: 89

Rep: Reputation: 15
This command:

ps -e

in the third column gives the time for the process.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Finding A Process's Idle Time On Linux And Unix LXer Syndicated Linux News 0 03-25-2009 12:20 PM
Please help fix: sky2 error: rx length error: status 0x42c0500 length 600 trapix22 Linux - Wireless Networking 1 10-25-2008 07:50 AM
perl spawning many process's Xris718 Programming 2 11-01-2005 12:50 PM
How do I change a process's priority? TheOneAndOnlySM Linux - General 2 03-12-2004 10:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration