SFML community forums

Help => General => Topic started by: bglaze on November 03, 2011, 11:29:32 am

Title: Time as float?
Post by: bglaze on November 03, 2011, 11:29:32 am
I was taught that when programming, Time is is typically stored using an integer that represents milliseconds. However, I see that SFML uses floats to represent Time.

Should all of my sub-times that get assigned by and then compared to ElapsedTime() be floats? If I have them as as integers, will SFML have to convert them, thus using more (though I'm sure only slightly) processor power?

Or was I simply taught wrong, and using floats is actually the norm?

Thanks!!
Title: Time as float?
Post by: P@u1 on November 03, 2011, 11:38:12 am
SFML 2.0 uses unsigned int.

You should not care for processor power which is needed to convert between float and (unsigned) int, it won't have a noticeable effect.
Title: Time as float?
Post by: bglaze on November 03, 2011, 07:43:08 pm
Thank you, P@u1!
Title: Time as float?
Post by: kolofsson on November 03, 2011, 10:38:12 pm
Since it's been mentioned, can anyone tell me why was time changed from float to integer milliseconds? If I ever wanted an integer, I could always round the value. Why is it rounded for me?
Title: Time as float?
Post by: Laurent on November 03, 2011, 11:02:54 pm
There's a thread for this modification:
http://www.sfml-dev.org/forum/viewtopic.php?t=4864