diff --git a/src/xrt/auxiliary/util/u_time.h b/src/xrt/auxiliary/util/u_time.h index b4c253b71..4d836a058 100644 --- a/src/xrt/auxiliary/util/u_time.h +++ b/src/xrt/auxiliary/util/u_time.h @@ -108,6 +108,19 @@ time_ns_to_ms_f(time_duration_ns ns) return (double)(ns) / (double)(U_TIME_1MS_IN_NS); } +/*! + * Convert double float milliseconds to nanoseconds, human comprehensible config + * inputs. Recommended to keep the absolute value of the input relitively small. + * + * @see timepoint_ns + * @ingroup aux_util + */ +static inline timepoint_ns +time_ms_f_to_ns(double ms_f) +{ + return (timepoint_ns)(ms_f * (double)(U_TIME_1MS_IN_NS)); +} + /*! * Checks if two timepoints are with a certain range of each other. *