Hello, How to print the Elapsed Time or FPS in the demo,and where

Hello, How to print the Elapsed Time or FPS in the demo,and where

hellohuan's picture

rt


Thank you!

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
havokdaniel's picture

Hi hellohuan,

The default value of hkDefaultDemo::m_timestep is 0.016f, which means that the demos all run at 62.5 FPS. The graphics is stepped synchronously with the physics so graphical FPS is the same as physics steps per second.

To get the elapsed time (.. of the whole demo.. but I'm not sure if this is what you're looking for), add a counter to a demo and add m_timestep in stepdemo(). You can print this value to the console and it will tell you how many seconds the simulation has been running.

Daniel

Login to leave a comment.