Author Topic: Calculate FPS?  (Read 5251 times)

0 Members and 1 Guest are viewing this topic.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Calculate FPS?
« on: February 12, 2012, 02:23:34 pm »
I was just wondering how, if at all, one could calculate the frames per second of an Axe program. I have an engine I'm writing in my spare time and I thought it'd be useful to see how many FPS it gets to compare my attempts at optimization as I work on it.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Calculate FPS?
« Reply #1 on: February 12, 2012, 02:28:47 pm »
The easiest solution is to test your program in Wabbitemu without the skin enabled. You should then see Wabbitemu's built-in FPS feature on the bottom of the window, which should be accurate for any Axe program. (It may not be accurate for assembly programs with custom screen updating methods, but you don't need to worry about that)

However, if you need an actual FPS counter built into your program, I would suggest using interrupts in your program and using them to keep track of and display an approximate FPS.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: Calculate FPS?
« Reply #2 on: February 12, 2012, 02:34:22 pm »
The easiest solution is to test your program in Wabbitemu without the skin enabled.

Ahh, thank you! I don't know anything about interrupts, though, so I'll just be content with Wabbit's lol.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Calculate FPS?
« Reply #3 on: February 12, 2012, 03:24:34 pm »
Or within the main loop, lake a counter.
If you know how to access the rtc, you can how how many frames are drawn between two clock ticks, and show it.

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: Calculate FPS?
« Reply #4 on: February 12, 2012, 03:26:27 pm »
Yeah, see, I don't even know what RTC stands for lol.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Calculate FPS?
« Reply #5 on: February 12, 2012, 03:55:49 pm »
Real time clock, what calculates the crystal ticks into time.