LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-23-2008, 05:41 PM   #1
tnjones
LQ Newbie
 
Registered: Aug 2008
Posts: 27

Rep: Reputation: 15
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
 
Old 09-23-2008, 07:00 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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...
 
Old 09-23-2008, 10:00 PM   #3
tnjones
LQ Newbie
 
Registered: Aug 2008
Posts: 27

Original Poster
Rep: Reputation: 15
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.
 
Old 09-23-2008, 11:41 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
'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>
 
  


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
Boot help please. More info this time! noasprin SUSE / openSUSE 14 11-22-2008 11:50 PM
Howto remove the info at that time of booting asprakash Linux - Embedded & Single-board computer 1 03-21-2008 09:44 AM
PPC (PowerPC) G4: Altivec & SMP Support: info, etc.; also, Mac Mini info, etc. HowDoIProgramIt Linux - Hardware 0 05-29-2007 01:19 PM
Trying Linux for the first time, Looking for info on becoming more involved CSMastermind Linux - Newbie 10 04-11-2006 12:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:36 AM.

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