Time Basics (The GNU C Library)

### 22.1 Time Basics ¶

Discussing time in a technical manual can be difficult because the word “time” in English refers to lots of different things. In this manual, we use a rigorous terminology to avoid confusion, and the only thing we use the simple word “time” for is to talk about the abstract concept.

A calendar time, sometimes called “absolute time”, is a point in the Earth’s time continuum, for example June 9, 2024, at 13:50:06.5 Coordinated Universal Time (UTC). UTC, formerly called Greenwich Mean Time, is the primary time standard on Earth, and is the basis for civil time and time zones.

We don’t speak of a “date”, because that is inherent in a calendar time.

An interval is a contiguous part of the time continuum between two calendar times, for example the hour on June 9, 2024, between 13:00 and 14:00 UTC.

An elapsed time is the length of an interval, for example, 35 minutes. People sometimes sloppily use the word “interval” to refer to the elapsed time of some interval.

An amount of time is a sum of elapsed times, which need not be of any specific intervals. For example, the amount of time it takes to read a book might be 9 hours, independently of when and in how many sittings it is read.

A period is the elapsed time of an interval between two events, especially when they are part of a sequence of regularly repeating events.

A simple calendar time is a calendar time represented as an elapsed time since a fixed, implementation-specific calendar time called the epoch. This representation is convenient for doing calculations on calendar times, such as finding the elapsed time between two calendar times. Simple calendar times are independent of time zone; they represent the same instant in time regardless of where on the globe the computer is.

POSIX says that simple calendar times do not include leap seconds, but some (otherwise POSIX-conformant) systems can be configured to include leap seconds in simple calendar times.

A broken-down time is a calendar time represented by its components in the Gregorian calendar: year, month, day, hour, minute, and second. A broken-down time value is relative to a specific time zone, and so it is also sometimes called a local time. Broken-down times are most useful for input and output, as they are easier for people to understand, but more difficult to calculate with.

A time zone is a single fixed offset from UTC, along with a time zone abbreviation that is a string of characters that can include ASCII alphanumerics, ‘`+`’, and ‘`-`’. For example, the current time zone in Japan is 9 hours ahead (east) of the Prime Meridian with abbreviation `"JST"`.

A time zone ruleset maps each simple calendar time to a single time zone. For example, Paris’s time zone ruleset might list over a dozen time zones that Paris has experienced during its history.

CPU time measures the amount of time that a single process has actively used a CPU to perform computations. It does not include the time that process has spent waiting for external events. The system tracks the CPU time used by each process separately.

Processor time measures the amount of time any CPU has been in use by any process. It is a basic system resource, since there’s a limit to how much can exist in any given interval (the elapsed time of the interval times the number of CPUs in the computer)

People often call this CPU time, but we reserve the latter term in this manual for the definition above.