Historically, UNIX systems have maintained two different time values:
- Calendar time. This value counts the number of seconds since the Epoch:
00:00:00 January 1, 1970, Coordinated Universal Time (UTC).
(Older manuals refer to UTC as Greenwich Mean Time.)
These time values are used to record the time when a file was last modified, for example.
The primitive system data type time_t holds these time values.
- Process time: This is also called CPU time and measures the central processor resources used by a process.
Process time is measured in clock ticks, which have historically been 50, 60, or 100 ticks per second.
The primitive system data type clock_t holds these time values. (Will show how to obtain the number of clock ticks per second with the sysconf function later.)
When we measure the execution time of a process, we will see that the UNIX System maintains three values for a process:
User CPU time
System CPU time
The output format from the time command depends on the shell being used, because
some shells do not
run /usr/bin/time, but instead have a separate built-in function to
measure the time it takes commands to run.