Not understanding CPU C programming benchmarks...

This is a discussion on Not understanding CPU C programming benchmarks... within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hello everyone, I was reading about POSIX threads and they gave a table about CPU usage. I don't understand the ...

  1. #1
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656

    Not understanding CPU C programming benchmarks...

    Hello everyone, I was reading about POSIX threads and they gave a table about CPU usage. I don't understand the difference between real, user, and sys . Could somebody help me out?
    Attached Images Attached Images  

  2. #2
    Banned
    Join Date
    Jun 2005
    Posts
    594
    Real - The elapsed (real) time between invocation of the application being timed and its termination.

    User - The User CPU time, equivalent to the sum of the tms_utime10.1 and tms_cutime 10.2fields returned by the times(2) function for the process in which utility is executed.

    Sys - The System CPU time, equivalent to the sum of the tms_stime 10.3 and tms_cstime 10.4 fields returned by the times(2) function for the process in which utility is executed.

  3. #3
    UT2004 Addict Kleid-0's Avatar
    Join Date
    Dec 2004
    Posts
    656
    Could you clarify on the difference between User and Sys time?

  4. #4

  5. #5
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    Quote Originally Posted by Kleid-0
    Could you clarify on the difference between User and Sys time?
    On a UNIX system, a process (an instance of a program running) will be executing in one of two modes; user mode, or kernel mode. The process will generally be in user mode until, for example, a system call is made. Then the mode switches to kernel mode in order to service the request. I believe that user time and system time corresponds to the time spent in both user mode and kernel mode respectively.

    If you are using a *nix machine (and I have assumed that you are) then look at the man pages for time and times(2)

    ~/
    Last edited by kermit; 07-22-2005 at 03:25 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pthread question
    By quantt in forum Linux Programming
    Replies: 7
    Last Post: 04-07-2009, 01:21 AM
  2. questions on multiple thread programming
    By lehe in forum C Programming
    Replies: 11
    Last Post: 03-27-2009, 07:44 AM
  3. Upgrading my old CPU (for another old one!)
    By foxman in forum Tech Board
    Replies: 16
    Last Post: 01-11-2008, 04:41 PM
  4. Can you still view the bios screen with a bad CPU?
    By HyperCreep in forum Tech Board
    Replies: 4
    Last Post: 12-31-2006, 05:57 PM
  5. CPU temp
    By PING in forum Tech Board
    Replies: 5
    Last Post: 01-28-2006, 05:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21