Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I am trying to get the process start time.I am fetching the 22nd field in /proc/pid/start file.But the time it gives is in jiffies.but i want start time as ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    5

    process start time


    Hi,
    I am trying to get the process start time.I am fetching the 22nd field in /proc/pid/start file.But the time it gives is in jiffies.but i want start time as per the system time in hh:mm:ss format.Can anyone tell me how to do this? i want to get start time from this file only.

  2. #2
    Just Joined!
    Join Date
    Feb 2012
    Location
    Hyderabad, India
    Posts
    11
    Quote Originally Posted by ravind007 View Post
    Hi,
    I am trying to get the process start time.I am fetching the 22nd field in /proc/pid/start file.But the time it gives is in jiffies.but i want start time as per the system time in hh:mm:ss format.Can anyone tell me how to do this? i want to get start time from this file only.
    if you know the jiffies, you can use the following code snippet to get the time.

    seconds = jiffies/HZ;
    minutes = seconds/60;
    hours = minutes/60;

    printf("\ntime = %d:%d:%d\n", hours,minutes,seconds);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •