mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 19:16:21 +00:00
u/time: Add ms to ns helper
This commit is contained in:
parent
f1bc10003d
commit
bfb3d7029c
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue