Getting delta time of OpenGL in Qt?
-
Depends on what you call a frame. Is it the time CPU spends on calculations for displaying, submitting work to the driver, the driver submitting commands to the GPU, GPU executing graphics and compute shaders, presenting a framebuffer to the output device, v-blank interval, v-sync points etc. Different apps different needs.
If all you want to know is how much time passes between calls to QOpenGLWidget::paintGL then simply create a
QElapsedTimerand call its restart() method. It will give you the time elapsed since you last called it.