I'm trying ctime or SDL_GetTicks() or anything I can find any info on, but I can't get a high-resolution millisecond count via C++.
Has anyone experienced this? Anyone have any suggestions?
I'm using Ubuntu and have installed linux-rt and the linux-rt headers, but no dice.
The precision of the time looks fine before calling SDL_Init, but afterwards the value is very small and it just updates about once every second. Ie., if I have a loop where I continually query the tick count, the output looks like this:
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1311, last time: 1307
curr time: 1340, last time: 1307
I'm doing SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER); before calling SDL_GetTicks();
I can post my program, but it's hella messy right now.