Skip to content

Commit

Permalink
clock() deprecated, use .perf_counter() or time.process_time() instea…
Browse files Browse the repository at this point in the history
…d, depending on your requirements, to have well-defined behavior.
  • Loading branch information
joqqy committed Dec 21, 2019
1 parent 3049cd3 commit deaf444
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swe.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
sample_interval = 1000 # How often to sample for time series
# =============== Done with setting up arrays and initial conditions ===============

t_0 = time.clock() # For timing the computation loop
t_0 = time.perf_counter() # For timing the computation loop

# ==================================================================================
# ========================= Main time loop for simulation ==========================
Expand Down Expand Up @@ -254,7 +254,7 @@
eta_list.append(eta_n)

# ============================= Main time loop done ================================
print("Main computation loop done!\nExecution time: {:.2f} s".format(time.clock() - t_0))
print("Main computation loop done!\nExecution time: {:.2f} s".format(time.perf_counter() - t_0))
print("\nVisualizing results...")

# ==================================================================================
Expand Down

0 comments on commit deaf444

Please sign in to comment.