diff options
Diffstat (limited to 'shared-bindings/time/__init__.c')
| -rw-r--r-- | shared-bindings/time/__init__.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 44f82c62e..2624384af 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -51,9 +51,8 @@ //| ... //| STATIC mp_obj_t time_monotonic(void) { - uint64_t time64 = common_hal_time_monotonic(); - // 4294967296 = 2^32 - return mp_obj_new_float(((uint32_t) (time64 >> 32) * 4294967296.0f + (uint32_t) (time64 & 0xffffffff)) / 1000.0f); + uint64_t ticks_ms = common_hal_time_monotonic_ms(); + return mp_obj_new_float(uint64_to_float(ticks_ms) / 1000.0f); } MP_DEFINE_CONST_FUN_OBJ_0(time_monotonic_obj, time_monotonic); |
