SFML community forums

General => Feature requests => Topic started by: dunce on October 23, 2009, 05:33:16 am

Title: Clock::GetElapsedTime()
Post by: dunce on October 23, 2009, 05:33:16 am
This function returns elapsed seconds as float. Thus the clock that starts with an application will lose its milliseconds in 27 hours. For stand-alone game it may be ok. No one would play the whole day and night through.  :)  But for some applications it may not be suitable. For my engine's task scheduler I need a clock with millisecond's precision and unsigned long capacity. Why not to extend sf::Clock with an appropriate function that returns elapsed milliseconds as unsigned long like Ogre's getMilliseconds()? The lack of this function makes developers implement their own timers or use 3d-party's ones.
Title: Clock::GetElapsedTime()
Post by: dunce on October 23, 2009, 10:36:13 am
Finaly I decided to create a full-featured Timer class that would work correctly with multi-core CPUs and could fire events. Though sf::Clock may be helpful for simple things.
Title: Clock::GetElapsedTime()
Post by: Laurent on October 24, 2009, 12:04:27 pm
I already received a patch for this and I'll fix it in SFML 2.