Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9d6d030f authored by Colin Cross's avatar Colin Cross
Browse files

uptime: Use clock_gettime to get monotonic time

The first field in /proc/uptime is bootbased time, not monotonic
time.  If the kernel tracks bootbased time correctly, it counts
elapsed run time as well as sleep time, which is the same as the
elapsed time in the android alarm driver, and sleep time is
always returned as 0.

Use clock_gettime(CLOCK_MONOTONIC) instead, which will return
elapsed run time not counting sleep time on all platforms.

Change-Id: I28a22e8c93d78f62666ee8c877c7c6718a2b640a
parent 8bc6fb34
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment