[vtkusers] Calculating frame rate

Francois Bertel francois.bertel at kitware.com
Wed Mar 24 14:10:07 EDT 2010


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;

On Wed, Mar 24, 2010 at 2:02 PM, Darshan Pai <darshanpai at gmail.com> wrote:
> Hello all,
>
> Is there any straightforward way to find the FPS of the rendering . I have a
> requirement where I can calculate the rendering frame rate and then use a
> textActor to display it .
>
> Any help is appreciated.
>
> Regards
> Darshan
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list