diff --git a/src/drivers/drv_hrt.h b/src/drivers/drv_hrt.h index bb62da0189c3..3e295abfc949 100644 --- a/src/drivers/drv_hrt.h +++ b/src/drivers/drv_hrt.h @@ -162,16 +162,7 @@ static inline void abstime_to_ts(struct timespec *ts, hrt_abstime abstime) */ static inline hrt_abstime hrt_elapsed_time(const hrt_abstime *then) { - hrt_abstime now = hrt_absolute_time(); - - // Cannot allow a negative elapsed time as this would appear - // to be a huge positive elapsed time when represented as an - // unsigned value! - if (*then > now) { - return 0; - } - - return now - *then; + return hrt_absolute_time() - *then; } /**