Beispiel #1
0
def post_run_stats(controller, sim):

    Logger.log("<----------------->")
    Logger.log("> Execution stats")

    Logger.log(">> Simulation lifespan: {} ticks".format(sim.lifetime))

    avg_draw = Profiler.get_numeric_category_avg("draw_times")
    if avg_draw is not None:
        Logger.log(">> Avg. drawing time: {} ms".format(avg_draw * 1000))
    avg_tick = Profiler.get_numeric_category_avg("tick_times")
    if avg_tick is not None:
        Logger.log(">> Avg. tick time: {} ms".format(avg_tick * 1000))

    Logger.log("<----------------->")
Beispiel #2
0
import Particles
from Particles.utils import Logger

import datetime, cProfile

# Time app
start_time = datetime.datetime.now()

# Initialize logfile
Logger.clear_logfile()
Logger.log("Started at " + str(start_time))

# Start the simulation
Particles.run_app("./config.json")
#cProfile.run("Particles.run_app()")

# Finish up logfile
end_time = datetime.datetime.now()
Logger.log("Quit at " + str(end_time))
Logger.log("Ran for {}".format(str(end_time - start_time)))