Hi, I have the following code, and wanted to get other set of eyes to make sure I have written the right code to calculate the frame rate of a scene. Could you please chime in?
This is written for the iPad using SDK 3.2.
thanks!
- (void)drawView:(id)sender
{
mach_timebase_info_data_t timer;
mach_timebase_info(&timer);
uint64_t t1 = mach_absolute_time();
[renderer render];
uint64_t delta = mach_absolute_time() - t1;
delta *= timer.numer;
delta /= timer.denom;
NSLog(@"%lld ms: %.2f FPS", delta, 1000000000.0f/delta);
}