Linux Timing Sources

Linux provides several mechanisms for event timing, ranging from 1-second down to submicrosecond resolution. This section discusses the following timing sources:

  • date— The resolution of date is 1s. Using the +%s formatter, date returns the number of seconds that have elapsed since 00:00:00, January 1, 1970.

  • jiffies— The resolution of jiffies is 10ms. On all platforms, Linux configures a hardware timer that interrupts the processor periodically—typically every 10ms (this value is defined in the kernel source as HZ). The timer interrupt routine increments the kernel variable jiffies by 1. Therefore, the value of jiffies represents the number of 10ms increments that have occurred since booting. It is possible to increase jiffies ...

Get Embedded Linux®: Hardware, Software, and Interfacing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.