Timing Calculations for Opengl ES 2.0 draw calls
- by Arun AC
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…