diff options
Diffstat (limited to 'ports/unix/unix_mphal.c')
-rw-r--r-- | ports/unix/unix_mphal.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/unix/unix_mphal.c b/ports/unix/unix_mphal.c index 42c22f7b5..f43067f64 100644 --- a/ports/unix/unix_mphal.c +++ b/ports/unix/unix_mphal.c @@ -214,3 +214,8 @@ mp_uint_t mp_hal_ticks_us(void) { return tv.tv_sec * 1000000 + tv.tv_usec; #endif } + +uint64_t mp_hal_time_ns(void) { + time_t now = time(NULL); + return (uint64_t)now * 1000000000ULL; +} |