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 06-15-2007, 02:26 PM   #1
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
pthreads.c - summary of thread execution times


Hi,
How would one go about getting the summary of execution time taken by a process and its children in C? If I have, say, a process which forks, and in turn creates some threads, is there an already-existent way to get the summary of the time taken by each?
Thanks.
 
Old 06-15-2007, 03:23 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
Assuming you want summarized values:
Code:
      #include <sys/times.h>

      clock_t times(struct tms *buffer);

           struct tms {
               clock_t     tms_utime;      /* user time */
               clock_t     tms_stime;      /* system time */"
               clock_t     tms_cutime;     /* user time, children */
               clock_t     tms_cstime;     /* system time, children */
           };
clock_t is 1/CLK_TCK seconds; CLK_TCK is defined as the return value of
sysconf( _SC_CLK_TCK );
 
  


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
Automatically measuring command execution times big_manel Linux - General 5 04-08-2007 08:52 PM
System hangs; Atheros Madwifi-ping times out every 15/16 times james 456 Linux - Networking 0 01-12-2006 06:55 PM
Kernel Thread Execution Context and PID ratwings Linux - Newbie 0 02-11-2005 04:06 AM
Main thread sending notification to child thread rajesh_b Programming 1 09-22-2004 09:15 AM
configure qt thread issue (just compiled qt w/ -thread option) cleff Linux - Software 8 05-07-2004 11:11 PM

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

All times are GMT -5. The time now is 04:42 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