Time

Linux Time Concepts

Time Units

sec - second

msec - millisecond 10^3

usec - microsecond 10^6

nanosec - nanosecond 10^9

picosec - picosecond

Time Categories

Wall time (Real time, Clock time, Elapsed time, Calendar time)
系统时间,真实时间,绝对时间,或者墙上时间。
Monotonic time (System uptime, time since boot up)
这个时间是单调递增的 linearly increasing,

Wall clock time 可能被修改:

Process time (CPU time)
CPU 用在处理某一个Process的时间,如果CPU Resource的使用情况。

include:

justin@Justin:~$ time -p cat
1 2 3 4 5 6 7 8 9 0
1 2 3 4 5 6 7 8 9 0
real 10.54
user 0.00
sys 0.01

justin@Justin:~$ time sleep 10

real    0m10.113s
user    0m0.000s
sys     0m0.012s

Useful in:

Time Format

Unix systems represent absolute time as the number of elapsed seconds since the epoch, which is defined as 00:00:00 UTC on the morning of 1 January 1970. UTC (Universal Time, Coordinated) is roughly GMT (Greenwich Mean Time) or Zulu time.

Time Epoch

2208988800UL 1970-1900 UTC

The TIME protocol, RFC-868

The TIME protocol is described in RFC-868.

The time server is listening on TCP/UDP port 37 and sends a 32-bit binary number (seconds since 1900-01-01 00:00.00 UTC).

This base will serve until time stamp 4294967295, which will be on 2036-02-07 06:28.14 UTC.

Example: 3346003716 , which translates to 2006-01-11 21:28:49.

The standardized data format refers to UTC (Coordinated Universal Time), no other time zones. This protocol cannot estimate network delays or report additional information. Note: Time stamp on 1970-01-01 00:00.00 UTC (begin of the unix epoch) was 2208988800.

Clock

software clock

hard clock

Wiki comments powered by Disqus