How to count FPS correctly?

I tried to count the FPS in my render loop like this:

while (!glfwWindowShouldClose(window)) {
    glfwPollEvents();
    float current = (float) glfwGetTime();
    delta = current - time;
    time = current;
    std::cout << 1.f / delta << std::endl;
    render();
    glfwSwapBuffers(window);
}

…with VSync enabled:

glfwSwapInterval(1);

…but the output looks like this:

72.0857
345.182
73.3988
343.092
71.9065
375.564
71.9188
353.294
71.9324
360.212
72.3131
277.364

So it seems like roughly every second draw call is skipped. How can I check if the drawing was skipped in a frame so that I doesn’t count it into the frame rate, what happens in these iterations and why are they skipped? I am on an ARM Mac if this is has some kind of influence.

Hi @julcs - welcome to the GLFW forum.

This might be that related to:

Thank you very much for your time this sounds exactly like the problem I have.
Apparently downgrading to GLFW 3.3 fixes the issue.