Avoid float -> int64 conversion #1993

This commit is contained in:
rusefillc 2020-12-03 10:26:50 -05:00
parent d803115081
commit df5c33ea86
1 changed files with 5 additions and 1 deletions

View File

@ -20,8 +20,11 @@
#define MS2US(MS_TIME) ((MS_TIME) * 1000)
// microseconds to ticks
#define US2NT(us) (((efitime_t)(us)) * US_TO_NT_MULTIPLIER)
// microseconds to ticks, but floating point
// If converting a floating point time period, use this macro to avoid
// the expensive conversions from int64 <-> float
#define USF2NT(us_float) ((us_float) * US_TO_NT_MULTIPLIER)
// And back
@ -29,6 +32,7 @@
// milliseconds to ticks
#define MS2NT(msTime) US2NT(MS2US(msTime))
// See USF2NT above for when to use MSF2NT
#define MSF2NT(msTimeFloat) USF2NT(MS2US(msTimeFloat))
/**