In XNA, the system calls update and draw function with the time information. This contains information such as how much time has passed since last update was called. This makes easy to integrate time and do animation calculation accordingly. But I dont see any such mechanism in openGL. I see openGL requires programmers to have their own implementation which could be buggy or inefficient. Is there any standard (and efficient) code that demonstrate this practice in openGL?
XNA can do this because it knows it's sitting on top of a Windows-like platform, and therefore has Windows-compatible timer functions. OpenGL can sit on top of any OS, and therefore it can't provide any such thing itself.
GLFW provides a lightweight cross-platform wrapper around OpenGL, including high-precision timing routines.
This is also something that is fairly straightforward to implement yourself, using