Skip to content

Commit bbaef7f

Browse files
committed
Perf counter
1 parent fc24448 commit bbaef7f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2389,17 +2389,17 @@ Profile
23892389
### Basic
23902390
```python
23912391
from time import time
2392-
start_time = time() # Seconds since the Epoch.
2392+
start_time = time() # Seconds since the Epoch.
23932393
...
23942394
duration = time() - start_time
23952395
```
23962396

23972397
### High Performance
23982398
```python
2399-
from time import perf_counter as pc
2400-
start_time = pc() # Seconds since restart.
2399+
from time import perf_counter
2400+
start_time = perf_counter() # Seconds since restart.
24012401
...
2402-
duration = pc() - start_time
2402+
duration = perf_counter() - start_time
24032403
```
24042404

24052405
### Timing a Snippet

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,16 +2052,16 @@
20522052
</code></pre></div>
20532053

20542054
<div><h2 id="profile"><a href="#profile" name="profile">#</a>Profile</h2><div><h3 id="basic">Basic</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> time <span class="hljs-keyword">import</span> time
2055-
start_time = time() <span class="hljs-comment"># Seconds since the Epoch.</span>
2055+
start_time = time() <span class="hljs-comment"># Seconds since the Epoch.</span>
20562056
...
20572057
duration = time() - start_time
20582058
</code></pre></div></div>
20592059

20602060

2061-
<div><h3 id="highperformance">High Performance</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> time <span class="hljs-keyword">import</span> perf_counter <span class="hljs-keyword">as</span> pc
2062-
start_time = pc() <span class="hljs-comment"># Seconds since restart.</span>
2061+
<div><h3 id="highperformance">High Performance</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> time <span class="hljs-keyword">import</span> perf_counter
2062+
start_time = perf_counter() <span class="hljs-comment"># Seconds since restart.</span>
20632063
...
2064-
duration = pc() - start_time
2064+
duration = perf_counter() - start_time
20652065
</code></pre></div>
20662066

20672067
<div><h3 id="timingasnippet">Timing a Snippet</h3><pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> timeit <span class="hljs-keyword">import</span> timeit

0 commit comments

Comments
 (0)