- Home /
Question by
thanik · Jun 21, 2015 at 06:00 PM ·
c#floatingpoint
How can I compare the float variables for performance?
I have to check the float value if it's more or less than a fixed float variable in every Update() function. Should I convert it to int (maybe multiply by 1000) then check or check the float value directly?
Comment
Best Answer
Answer by Graham-Dunnett · Jun 21, 2015 at 06:01 PM
Comparing a float in your Update()
isn't going to appear in any profiler results.
$$anonymous$$aybe I'm too afraid about the performance on comparing a float. $$anonymous$$y game is based on time so I have to make it precise on time.