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.

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). 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

  • Papers, articles, blog posts, and other texts about general topics usually use the day, hour, min/minutes, sec/second symbols which are widely used and understandable to everyone. In texts about time measurements and performance, we often use the d, h, m, s symbols instead (to be short).
  • The standard SI unit for microseconds is $\mu$s. Unfortunately, there is no $\mu$1 character on a typical keyboard. Also, you can have encoding troubles with this character in some text editors and terminals. Thus, developers often use the us symbol instead.
  • Common symbols for time and time intervals are t and T. Thus, if you see T=5s, it can mean “the time interval is equal to 5 seconds.”
  • There are other informal time units like jiffy or Flicks.

  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. ↩︎