This behavior calculates the frame rate and average frame rate of a
Java3D application.
The behavior sets itself up to wakeup every time a new frame is rendered.
The HotSpot(tm) compiler performs some initial optimizations before
running at optimal speed. Frame rates measured during this warmup period
will be inaccurate and not indicative of the true performance of the the
application. Therefore, before beginning the frame rate computation,
the frame counter waits for a fixed time period to allow the HotSpot(tm)
compiler to stablilize.
To avoid computing the frame rate too frequently (which would also
hamper rendering performance), the frame counter only computes the frame
rate at fixed time intervals. The default sampling duration is 10 seconds.
After waiting for the warmup period, the frame counter needs to calibrate
itself. It computes the number of frames rendered during the sampling
period. After doing this calibration, the frame counter reports the frame
rate after these many frames are rendered. It also reports the average
frame rate after a fixed number of sampling intervals (the default is 5).
The frame counter can be set up to run for a fixed number of sampling
intervals or to run indefinitely. The defaultis to run indefinitely.
|