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
By Tony Jones
·
2000Splitting 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:
Unit | Symbol | Duration in Seconds |
---|---|---|
Day | d (day) | 86400 |
Hour | h (hour) | 3600 |
Minute | m (min) | 60 |
Second | s (sec) | 1 |
Millisecond | ms | $10^{-3}$ |
Microsecond | us ($\mu$s) | $10^{-6}$ |
Nanosecond | ns | $10^{-9}$ |
Picosecond | ps | $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++
By Carl CookWhen a Microsecond is an Eternity: High Performance Trading Systems in C++).
When we are writing a BenchmarkBenchmark or a Performance TestPerformance Test for a Hot SpotHot 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 thed
,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
andT
. Thus, if you seeT=5s
, it can mean “the time interval is equal to 5 seconds.” - There are other informal time units like
jiffy
or FlicksFlicks.
$\mu$: Unicode Character
GREEK SMALL LETTER MU
(U+03BC
), ASCII code 230. You can type it viaAlt+230
on Windows,Option+m
on macOS,Ctrl+Shift+u00b5
on Linux. ↩︎