all repos — mgba @ 9bad312ee2634788dd40720eb5408dc477068c0a

mGBA Game Boy Advance Emulator

Tools: Quickly print perf fps
Vicki Pfau vi@endrift.com
Tue, 09 Mar 2021 21:29:45 -0800
commit

9bad312ee2634788dd40720eb5408dc477068c0a

parent

7e36ee16487f20f463aa25ee190c53ad04785e9f

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M tools/perf.pytools/perf.py

@@ -107,7 +107,7 @@ try:

self.socket = socket.create_connection(self.address, timeout=1000) break except OSError as e: - print("Failed to connect:", e) + print("Failed to connect:", e, file=sys.stderr) if backoff < self.RETRIES - 1: time.sleep(2 ** backoff) else:

@@ -166,9 +166,10 @@ results = []

sock = None for test in self.tests: print('Running test {}'.format(test.name), file=sys.stderr) + last_result = None if self.server: self.server.run(test) - print(self.server.results[-1]) + last_result = self.server.results[-1] else: try: test.run(self.cwd)

@@ -177,6 +178,9 @@ print('Interrupted, returning early...', file=sys.stderr)

return results if test.results: results.append(test.results) + last_result = results[-1] + if last_result: + print('{:.2f} fps'.format(int(last_result['frames']) * 1000000 / float(last_result['duration']))) if self.server: self.server.finish() results.extend(self.server.results)