The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
get Thread information from process umen Shell Programming and Scripting 2 02-12-2007 01:46 PM
Process information fermisoft UNIX for Dummies Questions & Answers 4 12-13-2006 04:56 PM
Report Process Information (Help me) jabcd Shell Programming and Scripting 1 02-21-2005 04:23 PM
pthreads run time information hmurali High Level Programming 0 07-17-2002 02:24 AM
Process Information rejise UNIX for Advanced & Expert Users 1 08-23-2001 10:09 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-11-2002
hmurali hmurali is offline
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 7
Unhappy Process Run time information

Hello,

I am working on Sun Solaris 5.7. I am trying to read the running time of a process through a C program.

One way I am reading it is by using the command ps -<pid> -f

The other way is from the struct psinfo_t which is there under /proc/pid/psinfo.

However, the two times are different. The time read from the shell using ps -<pid> -f appears to be more realistic.

Can someone please tell me which one to rely on ?

regards,
Murali
  #2 (permalink)  
Old 06-11-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
"ps -<pid> -f" is not legal. I only get an error message. Maybe you mean "ps -f <pid>"? But anyway, if a process needs to find out its own cpu usage, it should invoke the times() system call.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0