LMSouq
general-dev Open

What is the difference between CLOCK_MONOTONIC & CLOCK_MONOTONIC_RAW?

HO
hookenz
1 month ago
3 views
Problem Description
According to the Linux man page under Ubuntu CLOCK_MONOTONIC Clock that cannot be set and represents monotonic time since some unspecified starting point. CLOCK_MONOTONIC_RAW (since Linux 2.6.28; Linux-specific) Similar to CLOCK_MONOTONIC, but provides access to a raw hard‐ ware-based time that is not subject to NTP adjustments. According to the webster online dictionary Monotonic means: > 2: having the property either of never increasing or of never > decreasing as the values of the independent variable or the subscripts > of the terms increase. In other words, it won't jump backwards. I can see that this would be an important property if you were timing some code. However, the difference between the normal and raw version isn't clear. Can someone shed some light into how NTP can still affect CLOCK_MONOTONIC?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base