///| /// The main loop sleeps for a difference of two `monotonic_ms`: on the wall clock, NTP setting the /// time (1970 to now on a phone) froze the session for days. CLOCK_MONOTONIC can't be later than /// /proc/uptime, which also counts suspended time; the wall clock is far past it. test "monotonic_ms is not the wall clock" { let before = @sys.monotonic_ms() let text = @sys.read_proc_bytes("/proc/uptime") let mut secs = 0UL for c in text { guard c is (b'0'..=b'9') else { break } secs = secs * 10UL + (c - b'0').to_uint64() } assert_true(secs > 0UL) assert_true(before <= (secs + 1UL) * 1000UL) assert_true(@sys.monotonic_ms() >= before) }