Notes / Time Units


In this article, we discuss common time units that are used for time measurements.

One of the most basic time units is a second. It is the base unit of time in the International System of Units (SI). The exact definition according to the National Institute of Standards and Technology is the following:

One second is the duration of 9'192'631'770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium 133 atom.

If you are curious about the history of timekeeping and corresponding technical concepts, it is worth reading Splitting the Second: The Story of Atomic Time.

However, the usual domestic understanding of a second is typically enough. In SI, some additional time units are commonly used by software engineers. The most useful of them (with corresponding symbols and equivalents in seconds) are presented in the below table:

UnitSymbolDuration in Seconds
Dayd (day)86400
Hourh (hour)3600
Minutem (min)60
Seconds (sec)1
Millisecondms$10^{-3}$
Microsecondus ($\mu$s)$10^{-6}$
Nanosecondns$10^{-9}$
Picosecondps$10^{-12}$

One may think that a microsecond, a nanosecond, and a picosecond are very small time units, and we do not need them in real life. They are indeed very small. A picosecond relates to a second as a second relates to 31710 years. However, sometimes we should care about small time units like microseconds in real software (e.g., see When a Microsecond is an Eternity: High Performance Trading Systems in C++). When we are writing a Benchmark or a Performance Test for a Hot Spot, we often need nanoseconds, which is a typical time unit for short code snippets. Many single cpu instructions take even less than one nanosecond, so picoseconds may be also useful.

Remarks


  1. $\mu$: Unicode Character GREEK SMALL LETTER MU (U+03BC), ASCII code 230. You can type it via Alt+230 on Windows, Option+m on macOS, Ctrl+Shift+u00b5 on Linux. ↩︎


References (8)