Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3372bd6 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am 099aa9a1: am edbb8083: Merge "add a fps counter to sanangeles demo" into gingerbread

Merge commit '099aa9a1b4eaf6536decbcafac43476c4908ef24'

* commit '099aa9a1b4eaf6536decbcafac43476c4908ef24':
  add a fps counter to sanangeles demo
parents b34cd448 7d1588e4
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -191,23 +191,32 @@ int main(int argc, char *argv[])

    appInit();

    struct timeval timeTemp;
    int frameCount = 0;
    gettimeofday(&timeTemp, NULL);
    double totalTime = timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec;
    
    while (gAppAlive)
    {
        struct timeval timeNow;

        if (gAppAlive)
        {
        gettimeofday(&timeNow, NULL);
        appRender(timeNow.tv_sec * 1000 + timeNow.tv_usec / 1000,
                sWindowWidth, sWindowHeight);
        checkGLErrors();
        eglSwapBuffers(sEglDisplay, sEglSurface);
        checkEGLErrors();
        }
        frameCount++;
    }

    gettimeofday(&timeTemp, NULL);

    appDeinit();
    deinitGraphics();

    totalTime = (timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec) - totalTime;
    printf("totalTime=%f s, frameCount=%d, %.2f fps\n",
            totalTime, frameCount, frameCount/totalTime);

    return EXIT_SUCCESS;
}