PDA

View Full Version : how to calculate the execution time of over all program in opengl



alneam
03-17-2013, 11:36 AM
hello all...

what is the command that use in openGL to calculate the execution time of over all the program in opengl ???

thanks in advance

Aleksandar
03-17-2013, 04:14 PM
There is no such magical GL command. :)
Also, execution time cannot be calculated but measured.

Well, GL program executes both on CPU and GPU. CPU execution time can be measured by various system calls, and it is highly dependent on the operating system. On Windows using Performance Counter (http://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx) (QueryPerformanceCounter()/QueryPerformanceFrequency()) is the only valid solution. GPU execution time can be measured using timer query (http://www.opengl.org/registry/specs/ARB/timer_query.txt).