Avoid float -> int64 conversion #1993
This commit is contained in:
parent
d803115081
commit
df5c33ea86
|
@ -20,8 +20,11 @@
|
||||||
#define MS2US(MS_TIME) ((MS_TIME) * 1000)
|
#define MS2US(MS_TIME) ((MS_TIME) * 1000)
|
||||||
|
|
||||||
// microseconds to ticks
|
// microseconds to ticks
|
||||||
|
|
||||||
#define US2NT(us) (((efitime_t)(us)) * US_TO_NT_MULTIPLIER)
|
#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)
|
#define USF2NT(us_float) ((us_float) * US_TO_NT_MULTIPLIER)
|
||||||
|
|
||||||
// And back
|
// And back
|
||||||
|
@ -29,6 +32,7 @@
|
||||||
|
|
||||||
// milliseconds to ticks
|
// milliseconds to ticks
|
||||||
#define MS2NT(msTime) US2NT(MS2US(msTime))
|
#define MS2NT(msTime) US2NT(MS2US(msTime))
|
||||||
|
// See USF2NT above for when to use MSF2NT
|
||||||
#define MSF2NT(msTimeFloat) USF2NT(MS2US(msTimeFloat))
|
#define MSF2NT(msTimeFloat) USF2NT(MS2US(msTimeFloat))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue