Commit 3a67156
committed
Replace time.clock() with time.perf_counter() in slowsquare examples
Fixes #1757
time.clock() was removed in Python 3.8 in favor of time.perf_counter().
This commit updates the slowsquare RPC examples to use the modern API.
Changes:
- examples/twisted/wamp/rpc/slowsquare/frontend.py: 3 replacements
- examples/asyncio/wamp/rpc/slowsquare/frontend.py: 3 replacements
time.perf_counter() provides a monotonic clock with the best available
resolution for measuring performance, which is the intended behavior
for timing RPC call durations.
Tested with: just test-integration-ab-examples from crossbar repository1 parent 97b34a9 commit 3a67156
File tree
2 files changed
+6
-6
lines changed- examples
- asyncio/wamp/rpc/slowsquare
- twisted/wamp/rpc/slowsquare
2 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
0 commit comments