Avoid float -> int64 conversion #1993

This commit is contained in:
rusefillc 2020-12-03 10:31:16 -05:00
parent df5c33ea86
commit 7dbc9afa38
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,8 @@
#define MS2US(MS_TIME) ((MS_TIME) * 1000)
// microseconds to ticks
// since only about 20 seconds of ticks fit in 32 bits this macro is casting parameter into 64 bits 'efitime_t' type
// please note that int64 <-> float is a heavy operation thus we have 'USF2NT' below
#define US2NT(us) (((efitime_t)(us)) * US_TO_NT_MULTIPLIER)
// microseconds to ticks, but floating point