
-----------------------------------
berrberr
Wed Nov 15, 2006 9:27 pm

Frames per second counter?
-----------------------------------
Hi I was wondering if anyone has an example, or can explain how to make an FPS counter and display it on the screen. I ahve searched for a while, and only found examples of ways to decrease the frame rate, and not actually display it. I want an FPS counter because I'm testing out different methods of drawing graphics for my game in order to speed it up. Thanks  :P

-----------------------------------
Clayton
Wed Nov 15, 2006 9:31 pm


-----------------------------------
well FPS is Frames Per Second right? So count how many Frames (or iterations of your loop) happen per second (6000 milliseconds), if the amount of frames in that time is over the amount you want, don't draw another frame, if it is under or equal to the number of FPS you want, then draw the image.

-----------------------------------
berrberr
Wed Nov 15, 2006 11:11 pm


-----------------------------------
Thanks for the reply, but Im not quite sure oyou understood what I'm asking for. I want to display how many frames are being displayed per ssecond on my program and not adjust the fram rate...just display it.

-----------------------------------
Dan
Thu Nov 16, 2006 1:23 am


-----------------------------------
[url=http://compsci.ca/v2/viewtopic.php?t=7393&highlight=fps][Snippit] FPS Limiter

[url=http://compsci.ca/v2/viewtopic.php?t=859&highlight=fps][tutorial]Frame per Seconds

-----------------------------------
NikG
Thu Nov 16, 2006 10:37 am


-----------------------------------
So count how many Frames (or iterations of your loop) happen per second (6000 milliseconds)...Isn't that 1000 miliseconds per second?

berrberr, even if you don't want to actually limit the fps of your program, what Freakman said and the two links Hacker Dan provided should help you achieve what you want.  All you have to do is reset your framecounter after every second.

-----------------------------------
Clayton
Thu Nov 16, 2006 11:37 am


-----------------------------------
Errr... Yes, I was thinking of something else that i was working on which required a 6 second check. If you just want to output the amount of Frames, its still the same process as an FPS limiter without the limiting :P
