MCPcopy Create free account
hub / github.com/PufferAI/pokegym / performance_test

Function performance_test

test.py:16–29  ·  view source on GitHub ↗
(game_cls, steps=10000)

Source from the content-addressed store, hash-verified

14 game.step(game.action_space.sample())
15
16def performance_test(game_cls, steps=10000):
17 game = game_cls()
18 game.reset()
19
20 for _ in range(1000):
21 game.step(0)#game.action_space.sample())
22
23 start = time.time()
24 for _ in range(steps):
25 game.step(0)#game.action_space.sample())
26
27 game.close()
28 end = time.time()
29 print('Steps per second: {}'.format(steps / (end - start)))
30
31if __name__ == '__main__':
32 performance_test(PokemonRed)

Callers 1

test.pyFile · 0.85

Calls 3

resetMethod · 0.45
stepMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected