[vtkusers] Calculating frame rate

David Doria daviddoria+vtk at gmail.com
Wed Mar 24 14:15:31 EDT 2010


On Wed, Mar 24, 2010 at 2:10 PM, Francois Bertel <
francois.bertel at kitware.com> wrote:

> Hello,
>
> Here is the code to measure the rendering time:
>
>
> vtkRenderWindow *r=vtkRenderWindow::New();
> vtkTimerLog *t=vtkTimerLog::New();
>
> [...]
>
> t->StartTimer();
> r->Render();
> r->WaitForCompletion();
> t->StopTimer();
>
> double timeInSeconds=t->GetElapsedTime();
> double fps=1.0/timeInSeconds;
>

So where would be the best place to put this code? Do you have to subclass
the interactor style and put the timer code around which ever function calls
Render()? It seems like we should make a vtkRenderWindow::GetFrameRate() -
what do you think Francois?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100324/5ce80536/attachment.htm>


More information about the vtkusers mailing list