Get current fps

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/09/2011 at 10:02, xxxxxxxx wrote:

User Information:
Cinema 4D Version:    
Platform:      
Language(s) :

---------
Hello again,

How to get the current fps of the viewport? Or how can I calculate them?

I do not find any method execpt of doc->GetFps(), but this is the fps for animation.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/09/2011 at 12:43, xxxxxxxx wrote:

I'd think the simplest way to do it would be to measure the time between redraws in a scenehook or something like that. I don't know if Cinema has a built in function for this.

- Carter

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/09/2011 at 03:22, xxxxxxxx wrote:

You should get a fps by dividing 1000ms with time difference.
Time being system time that you get with: time()

Rough coffee:

  
var lastTime = 0;   
main(doc,op)   
{   
var fps      = 1000.0 / (time() - lastTime);   
      lastTime = time(); // <- store time   
}   

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/09/2011 at 05:50, xxxxxxxx wrote:

Thank you both, got it now by my own.

In C++:

  
timediff=GeGetMilliSeconds();  
DrawViews(DRAWFLAGS_ONLY_ACTIVE_VIEW|DRAWFLAGS_NO_THREAD);  
fps=1000/(GeGetMilliSeconds()-timediff)