Skip to content
Snippets Groups Projects
Commit b5809582 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/unix_mphal: Implement mp_hal_ticks_us().

Similar to existing mp_hal_ticks_ms().
parent 5a2a4e94
Branches
Tags
No related merge requests found
...@@ -191,3 +191,9 @@ mp_uint_t mp_hal_ticks_ms(void) { ...@@ -191,3 +191,9 @@ mp_uint_t mp_hal_ticks_ms(void) {
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000; 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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment