diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c index 9a0e631b0b..0c9c884942 100644 --- a/src/lib/timestamp.c +++ b/src/lib/timestamp.c @@ -174,3 +174,14 @@ void timestamp_reinit(void) /* Call timestamp_reinit at CAR migration time. */ CAR_MIGRATE(timestamp_reinit) + +/* Provide default timestamp implementation using monotonic timer. */ +uint64_t __attribute__((weak)) timestamp_get(void) +{ + struct mono_time t1, t2; + + mono_time_set_usecs(&t1, 0); + timer_monotonic_get(&t2); + + return mono_time_diff_microseconds(&t1, &t2); +}