Hi!
I'm writing a game framework in C and I would like to benchmark my code.
I've tried including <time.h> and using the clock, but it seems that the NES doesn't have one... (please correct me if I'm wrong).
The emulator (Nestopia, Mesen, FCEUX) always displays 60fps, which does not reflect the game's internal speed.
I've tried using the Lag Counter, but that's not exactly what I'm after.
In Python, I would do it like this:
Do you guys know any way to achieve this, in either C or inline assembly?
If not, what the alternative? How do you guys benchmark your code?
Many thanks in advance.
I'm writing a game framework in C and I would like to benchmark my code.
I've tried including <time.h> and using the clock, but it seems that the NES doesn't have one... (please correct me if I'm wrong).
The emulator (Nestopia, Mesen, FCEUX) always displays 60fps, which does not reflect the game's internal speed.
I've tried using the Lag Counter, but that's not exactly what I'm after.
In Python, I would do it like this:
Code:
from time import time
def main_loop:
timestamp = time()
...
do_heavy_stuff()
...
...
fps = 1 / (time() - timestamp)
print(fps)
def main_loop:
timestamp = time()
...
do_heavy_stuff()
...
...
fps = 1 / (time() - timestamp)
print(fps)
Do you guys know any way to achieve this, in either C or inline assembly?
If not, what the alternative? How do you guys benchmark your code?
Many thanks in advance.