How to measure performance with @time?


I want to measure how long the following solver takes:

#Q-Learning solver
q_learning_solver = QLearningSolver(n_episodes=1000, 
                                max_episode_length = 1000,
                                learning_rate= 0.001
                                exploration_policy= EpsGreedyPolicy(mdp,0.01), 
                                eval_every = 100, 
                                n_eval_traj = 20, 
q_learning_policy = solve(q_learning_solver, mdp)

I have tried @time q_learning_policy but it doesn`t work. What is the correct way to use @time ?

You should try

@time q_learning_policy = solve(q_learning_solver, mdp)
1 Like

Please consider using BenchmarkTools for measuring performance.

1 Like


Thanks it worked!