I need to calculate the frames per second for an opengl program i'm writing, but in all my C/C++ books i have, the functions from time.h can only give time in seconds. Does anyone know what i could do to get time in something like milliseconds?
Strike
06-08-2001, 11:30 AM
gettimeofday(2) uses a struct timeval which has seconds and microseconds. But I think that Linux has at best something like a resolution of a hundred microseconds, so don't use it for anything smaller than 0.1 milliseconds (which, unless you are getting 10,000 fps, shouldn't be a problem)