How do you determine frame rate?

Started by
2 comments, last by 1kevgriff 23 years, 7 months ago
I''m new to programming, and everyone talks about frame rate. I''m curious, how do you determine framerate? I''ve been working with C++. Also, what are good frame rates and what are bad one''s? Thanks in advance.
Advertisement
Well, the easiest way to do it is to set up a timer which calls a certain function (say, FpsCount()) every second. Each frame you draw, you increase some varaible (FramesDrawn, for example) by one. When the timer calls FpsCount(), it should display FramesDrawn, and then reset it to zero. I''m sure there are other ways, but this way does work.

Martee
Magnum Games
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
quote:
Also, what are good frame rates and what are bad one's?


The human eye can't see above 24 FPS (I think that's the correct number), so basically, anything about 24 is good You'd want to get a framerate that's as high as possible.

Edited by - Muzzafarath on August 26, 2000 4:59:40 PM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
framerate would be how many frames per second you manage to display. so if you have a variable that you increment for each frame drawn, and the time for the last time you set that variable to zero, you can average the frame rate at the current time (average_framerate = n_frames/(current_time_in_seconds - time_when_I_last_reset_the_frame_counter) )

now, just update this number from time to time (If you update the framerate for each frame, you'll probably have such a varying number it's be hard to read. it's better to average it for a few (20-40 ?) frames) before recalculating the average framerate.

You know, I never wanted to be a programmer...

Alexandre Moura

Edited by - alexmoura on August 26, 2000 5:54:07 PM

This topic is closed to new replies.

Advertisement