osdep/timer: update documentation and test for mp_time_ns

No longer true after 8bbcc87fee.
This commit is contained in:
Kacper Michajłow 2024-01-24 17:02:26 +01:00 committed by Dudemanguy
parent ab491472f4
commit 19a6b84915
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@
// Initialize timer, must be called at least once at start. // Initialize timer, must be called at least once at start.
void mp_time_init(void); void mp_time_init(void);
// Return time in nanoseconds. Never wraps. Never returns 0 or negative values. // Return time in nanoseconds. Never wraps. Never returns negative values.
int64_t mp_time_ns(void); int64_t mp_time_ns(void);
// Return time in seconds. Can have down to 1 nanosecond resolution, but will // Return time in seconds. Can have down to 1 nanosecond resolution, but will

View File

@ -13,7 +13,7 @@ int main(void)
/* timekeeping */ /* timekeeping */
{ {
int64_t now = mp_time_ns(); int64_t now = mp_time_ns();
assert_true(now > 0); assert_true(now >= 0);
mp_sleep_ns(MP_TIME_MS_TO_NS(10)); mp_sleep_ns(MP_TIME_MS_TO_NS(10));