summaryrefslogtreecommitdiffstatshomepage
path: root/unix/unix_mphal.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/unix_mphal.c')
-rw-r--r--unix/unix_mphal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/unix/unix_mphal.c b/unix/unix_mphal.c
index df37976272..6c66662362 100644
--- a/unix/unix_mphal.c
+++ b/unix/unix_mphal.c
@@ -191,3 +191,9 @@ mp_uint_t mp_hal_ticks_ms(void) {
gettimeofday(&tv, NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
+
+mp_uint_t mp_hal_ticks_us(void) {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec * 1000000 + tv.tv_usec;
+}