LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Info on Time(1) (https://www.linuxquestions.org/questions/programming-9/info-on-time-1-a-671898/)

tnjones 09-23-2008 05:41 PM

Info on Time(1)
 
Hello,
I have this project where I need to time how long a certain process take based on the system clock(in seconds) and as well as in real time. I have been searching for weeks now and the deadline is approaching for the assignment. I have came across time() in Linux and it will give you the user, real, and system time,which is great but I don't know if the given time is just for that particular process and also I just want the real and system time but when calling such function it returns the three times automatically. With all of this in mind, Can anyone assist me with this problem(how to just time a given process and just receive the real and system time).Any advice will be appreciated!!

Thanks In Advance

chrism01 09-23-2008 07:00 PM

Sounds awfully like your other post: http://www.linuxquestions.org/questi...time.h-671662/
Maybe you could show us your code so far, this is Homework after all...

tnjones 09-23-2008 10:00 PM

Chrism01,
"Sounds awfully", what do you mean by this? I have been searching for some time now about how to get the system clock and have found several functions but came across the time() function today and seems like it does what I am looking for but just had some questions. As far as code goes, yes I have code but not pertaining to the time function. I mean to use the time function you just have to call it within the program.

chrism01 09-23-2008 11:41 PM

'Sounds awfully like ' alternative way of saying 'sounds a lot like'...

You prob want the GNU version of time. See man time, halfway down. Invoke as

\time %E %s <yourprog>


All times are GMT -5. The time now is 12:47 PM.