I am trying to understand how time is measured by the Linux kernel. I tried to go through the kernel code, but I miss the big picture to understand the code that I'm reading, even if this article helped a lot. In particular, I would like to understand how the following functions are related:
My questions are:
- Do they depend on each other? Is
gettimeofdayimplemented in terms of
clock_gettimeor vice-versa? Is
getrusageimplemented in terms of
- If they depend on each other then, what is the most fundamental one (lower level)?
- If they do not depend on each other, is there an internal mechanism on which they all depend? A lower-level function of the kernel that they all call?
- If they do not depend on each other and there is no common underlying mechanism, what is the reason for that?
Note: links to linux kernel code are very welcome to help to understand how all that works.