5

I'm trying to measure the execution time of portions of Linux Kernel code and found that there are two different subsystems for timers. hrtimers stands for high resolution timer while hpet means high precision event timer.

How does resolution differs from precision?

http://www.mjmwired.net/kernel/Documentation/timers/

danyowdee
  • 4,658
  • 2
  • 20
  • 35
Peter
  • 1,753
  • 18
  • 19

1 Answers1

5

HPET refers to a specific piece of x86 PC platform hardware (which Linux does have a driver for). HPET is described in eg this wikipedia artitcle: http://en.wikipedia.org/wiki/High_Precision_Event_Timer

hrtimers are a Linux subsystem that give a general framework for the software abstraction of "high resolution timers". hrtimers are the interface that most generic Linux kernel code should use, while HPET is a hardware feature that the low-level, platform-specific time-keeping code uses.

Roland
  • 6,227
  • 23
  • 29
  • thanks! But do you know if are there differences between precision and resolution in the timer subsystem context? []'s – Peter Feb 11 '12 at 14:36
  • 1
    @PeterSenna - I'm merely speculating about this; but I think "high resolution" would refer to being able to control timesteps smaller than what HZ (jiffies) would provide; "precision" would be how well the processor/OS manages the requested delays (e.g. even if you request the same delay repeatedly, you'll get variance). In http://stackoverflow.com/questions/16920238/reliability-of-linux-kernel-add-timer-at-resolution-of-one-jiffy, I want low resolution (timer hits each jiffy), but I have a problem with precision being bad anyways (kernel may skip a whole jiffy == a whole period). – sdaau Jun 04 '13 at 22:17