-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use sleep-aware monotonic clock if available #1189
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1189 +/- ##
=======================================
Coverage 84.23% 84.23%
=======================================
Files 57 57
Lines 5980 5980
=======================================
Hits 5037 5037
Misses 943 943 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…hich is very similar but earlier version-wise
#if defined(CLOCK_MONOTONIC_RAW) | ||
#if defined(CLOCK_BOOTTIME) | ||
# define HIGH_RES_CLOCK CLOCK_BOOTTIME | ||
#elif defined(CLOCK_MONOTONIC_RAW) | ||
# define HIGH_RES_CLOCK CLOCK_MONOTONIC_RAW |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we preferred CLOCK_MONOTONIC_RAW:
docs say:
Similar to CLOCK_MONOTONIC, but provides access to a raw hardware-based time that is not subject to NTP adjustments or the incremental adjustments performed by adjtime.
but with this change we'd prefer CLOCK_BOOTTIME, which days say:
Identical to CLOCK_MONOTONIC, except it also includes any time that the system is suspended.
So we'd be subject again to "NTP adjustments or the incremental adjustments performed by adjtime"
Just pointing it out. I don't know enough about this off the top of my head to gauge the full repercussions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I just did some more reading on all this. BOOTTIME seems fine for our purposes.
aws/aws-iot-device-sdk-java-v2#608
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.