From bbaef7f3d43cb001b464858d391603a7c55636b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 4 Aug 2019 05:11:39 +0200 Subject: [PATCH] Perf counter --- README.md | 8 ++++---- index.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0990fe7..99efd7f 100644 --- a/README.md +++ b/README.md @@ -2389,17 +2389,17 @@ Profile ### Basic ```python from time import time -start_time = time() # Seconds since the Epoch. +start_time = time() # Seconds since the Epoch. ... duration = time() - start_time ``` ### High Performance ```python -from time import perf_counter as pc -start_time = pc() # Seconds since restart. +from time import perf_counter +start_time = perf_counter() # Seconds since restart. ... -duration = pc() - start_time +duration = perf_counter() - start_time ``` ### Timing a Snippet diff --git a/index.html b/index.html index b033619..a2fda15 100644 --- a/index.html +++ b/index.html @@ -2052,16 +2052,16 @@ run(host='0.0.0.0', port=#Profile

Basic

from time import time
-start_time = time()                  # Seconds since the Epoch.
+start_time = time()                     # Seconds since the Epoch.
 ...
 duration = time() - start_time
 
-

High Performance

from time import perf_counter as pc
-start_time = pc()                    # Seconds since restart.
+

High Performance

from time import perf_counter
+start_time = perf_counter()             # Seconds since restart.
 ...
-duration = pc() - start_time
+duration = perf_counter() - start_time
 

Timing a Snippet

>>> from timeit import timeit