diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/reperf.py | 4 | ||||
-rw-r--r-- | Lib/test/sortperf.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/reperf.py b/Lib/test/reperf.py index 7c68234..e93bacd 100644 --- a/Lib/test/reperf.py +++ b/Lib/test/reperf.py @@ -9,13 +9,13 @@ def main(): timefunc(10, p.findall, s) def timefunc(n, func, *args, **kw): - t0 = time.clock() + t0 = time.perf_counter() try: for i in range(n): result = func(*args, **kw) return result finally: - t1 = time.clock() + t1 = time.perf_counter() if n > 1: print(n, "times", end=' ') print(func.__name__, "%.3f" % (t1-t0), "CPU seconds") diff --git a/Lib/test/sortperf.py b/Lib/test/sortperf.py index 0ce88de..af7c0b4 100644 --- a/Lib/test/sortperf.py +++ b/Lib/test/sortperf.py @@ -57,9 +57,9 @@ def flush(): sys.stdout.flush() def doit(L): - t0 = time.clock() + t0 = time.perf_counter() L.sort() - t1 = time.clock() + t1 = time.perf_counter() print("%6.2f" % (t1-t0), end=' ') flush() |