Hi all,
I’m trying to run a nengo simulator and time the actual amount of time it takes to run the simulation. If I try to use time.time() before and after the sim.run(x) call, it will output an incorrect time. For instance if I do sim.run(2), it will say it took 20 seconds to run, but the expected value is about 5 seconds and I hand timed it to also be about 5 seconds.
Alternatively, if I use Spyder and set breakpoints before and after I use time.time(), then I will get the correct timing. So I’m guessing there is some sort of precompile before I can run the simulation and that’s causing the problem with timing the simulation.
Does anyone know how to properly time a nengo simulation and have it output the correct time?
Below is my code:
with nengo.Simulator(model) as sim:
start = time.time()
sim.run(2)
end = time.time()
print(end - start)