Notice! This document is currently in Archived status.
The content of this document may be incorrect or outdated.

User Time vs. System Time

Purdue Computer Network

Programs such as time will tell you how much time your command spends in user time and how much is spent in system time. But what is the difference?

User Time
This is the amount of time the command spends in "User Mode." User Mode is a "safety" feature because when a program is in User Mode it cannot cause other programs to crash, or behave unexpectedly.
System Time
System Time is the amount of time the command spends in "Kernel Mode." There are certain tasks a command must run in Kernel Mode to accomplish, however since a command can misbehave while in Kernel Mode, they only go into Kernel Mode when they have to do so.

Here is an example use of time and it's output:

% time ls -R /usr
1.99u 5.74s 0:12.86 58.0%

What this means:

The first value is the number of seconds spent in user time. The next value is the number of seconds spent in system time. The third value is the total amount of time it took the command to execute. Note: this is not column 1 + column 2. This is because the command spends time doing nothing, waiting for it's turn to execute. The final column is the percentage of the total time spent in both user and system time.

If you are not using csh your output may look like this:

> time ls -R /usr
real	12.4
user	 1.7
sys	 5.5

In this case it is clear what the different values are and what they mean.

Last modified: 2007/03/07 11:43:38.056000 US/Eastern by Unknown
Created: 2007/03/07 11:43:38.056000 US/Eastern by brian.r.brinegar.1.


Search the Knowledge Base


Quick search results

    Admin Options: Edit this Document