So we at Build A World have discovered a bug in Irrlicht that has most probably been there since the dawn of time.
Namely irrlicht is returning system time in milliseconds as the RealTime, however it is doing that in the u32 format.
U32 is ONLY sufficient for real time (time since the start of 1970) if you are counting in SECONDS.
If you wish to return MILISECONDS, then you need to use int64_t or uint64_t because otherwise you run out of precision by March 1970.
And if you have for example, a server app... which has almost 99% uptime... then you are sure to run into an integer overflow (on a certain date at a certain time every 49 days) and a crash or bug which is timing related.
Please change your timer data type to 64bit int, I do not care if its signed or unsigned
ITimer::getReadlTime() EPIC BUG
Re: ITimer::getReadlTime() EPIC BUG
again... looking for a bug in baw, which wasn't there... was in fundaments of irr
Build A World -> http://www.buildaworld.net/
Build A World EDU -> http://edu.buildaworld.net/
BAW on Facebook -> http://www.facebook.com/BuildAWorld.net
BAW on YouTube -> http://www.youtube.com/user/wwwbuildaworldnet/videos
Build A World EDU -> http://edu.buildaworld.net/
BAW on Facebook -> http://www.facebook.com/BuildAWorld.net
BAW on YouTube -> http://www.youtube.com/user/wwwbuildaworldnet/videos
Re: ITimer::getReadlTime() EPIC BUG
Funny what counts as epic these days. Interface shows it's just using 32-bit which is exactly what it does.
Using 64-bit for this means we are starting to lie on systems where only a 32-bit counter is used (which is used when users don't request a high-performance counter for example).
edit: I'll put it on my todo. Maybe we can use 32-bit counters with wrap-around checks and counting the wrap-arounds. As long as tick is called once very few days that would work.
Using 64-bit for this means we are starting to lie on systems where only a 32-bit counter is used (which is used when users don't request a high-performance counter for example).
edit: I'll put it on my todo. Maybe we can use 32-bit counters with wrap-around checks and counting the wrap-arounds. As long as tick is called once very few days that would work.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: ITimer::getReadlTime() EPIC BUG
yeah but the 32bit counter gets multiplied by 1000 to convert seconds to miliseconds
Re: ITimer::getReadlTime() EPIC BUG
Yes, Irrlicht timer isn't good choice (in my personal projects I use custom timer) mainly on mobiles (often sync a timer via network), because it use "gettimeofday" function inside ITimer class. We should use "clock_gettime" with "CLOCK_MONOTONIC". I'll fix that in upcoming days (currently I work with my tasks required for merge ogl-es with trunk, but I should find some time for replace "gettimeofday" by "clock_gettime" + "CLOCK_MONOTONIC").
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: ITimer::getReadlTime() EPIC BUG
Not familiar with that one... monotonic sounds a little bit like getTickCount on Windows from the description. Are you sure that's a high-resolution timer?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: ITimer::getReadlTime() EPIC BUG
This is nice article about timers:
http://tdistler.com/2010/06/27/high-per ... ux-windows
When I started to use CLOCK_MONOTONIC my games on Linux and Android works much better than before.
http://tdistler.com/2010/06/27/high-per ... ux-windows
When I started to use CLOCK_MONOTONIC my games on Linux and Android works much better than before.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: ITimer::getReadlTime() EPIC BUG
Thanks, sounds good then.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm