Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Frame Rate Limiter and Counter

Hi guys,

I'm having troubles calculating the frame rate from my app. I've used NSDate and timeIntervalSinceDate but just seem to be getting errors which seem fairly trivial, but just wont work as all the examples i've seen.

The code i've been using is:


NSDate *startDate = [NSDate date];

//rendering etc in here

NSDate *endDate = [NSDate date];

NSLog(@\"Time elapsed: %f\", [endDate timeIntervalSinceDate:startDate]);


This just seems to throw errors and crash my app. I've seen these lines in many examples, but don't understand why i'm not getting any real values. The one time i did manage to get it working, the onyl value returned was 0.0.

Ideally, i want to check to see when a certain time interval has passed, most likely every 1/10th of a second, but currently, any value will do as long as i can see it working. I'd like to use this to limit my logic in my app without having to update everything as it is being rendered and also to maintain a persistent rate of performance.

Has anyone else had any trouble with this, or come across a better method of calculating the frame rate of an app? Any help would be greatly appreciated.
Post edited by CaptainRedmuff on

Replies

Sign In or Register to comment.