Try this code.
I’m not convinced that all of the frames always match with the VSYNC just by chance.
[pre]
for (int i=0;;i++)
{
int colorFlag=i%3;
colorFlag=(0x01<<colorFlag);
glClearColor(0x01&colorFlag,(0x02&colorFlag)>>1,(0x04&colorFlag)>>2,1);
glClear(GL_COLOR_BUFFER_BIT);
eglSwapBuffers( display, surface);
Sleep(rand()%17);
}
[/pre]