Timing Calculations for Opengl ES 2.0 draw calls
Posted
by
Arun AC
on Game Development
See other posts from Game Development
or by Arun AC
Published on 2013-10-21T07:22:28Z
Indexed on
2013/10/21
10:18 UTC
Read the original article
Hit count: 339
I am drawing a cube in OpenGL ES 2.0 in Linux. I am calculating the time taken for each frame using below function
#define NANO 1000000000
#define NANO_TO_MICRO(x) ((x)/1000)
uint64_t getTick() { struct timespec stCT; clock_gettime(CLOCK_MONOTONIC, &stCT); uint64_t iCurrTimeNano = (1000000000 * stCT.tv_sec + stCT.tv_nsec); // in Nano Secs uint64_t iCurrTimeMicro = NANO_TO_MICRO(iCurrTimeNano); // in Micro Secs
return iCurrTimeMicro; }
I am running my code for 100 frames with simple x-axis rotation. I am getting around 200 to 220 microsecs per frame.
that means am i getting around (1/220microsec = 4545) FPS Is my GPU is that fast? I strongly doubt this result.
what went wrong in the code?
Regards, Arun AC
© Game Development or respective owner