Skip to content

Commit b580958

Browse files
committed
unix/unix_mphal: Implement mp_hal_ticks_us().
Similar to existing mp_hal_ticks_ms().
1 parent 5a2a4e9 commit b580958

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

unix/unix_mphal.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,9 @@ mp_uint_t mp_hal_ticks_ms(void) {
191191
gettimeofday(&tv, NULL);
192192
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
193193
}
194+
195+
mp_uint_t mp_hal_ticks_us(void) {
196+
struct timeval tv;
197+
gettimeofday(&tv, NULL);
198+
return tv.tv_sec * 1000000 + tv.tv_usec;
199+
}

0 commit comments

Comments
 (0)