From 6fa3c0bbaf3a4850fc3d5e89b46688981a4fdf80 Mon Sep 17 00:00:00 2001 From: Hajime Senuma Date: Fri, 6 Sep 2024 20:09:48 +0900 Subject: [PATCH] Fix deprecated method in bench_time_func example (#202) --- doc/examples/bench_time_func.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/examples/bench_time_func.py b/doc/examples/bench_time_func.py index e9569d49..4d8cb43d 100755 --- a/doc/examples/bench_time_func.py +++ b/doc/examples/bench_time_func.py @@ -1,10 +1,11 @@ #!/usr/bin/env python3 +import time import pyperf def bench_dict(loops, mydict): range_it = range(loops) - t0 = pyperf.perf_counter() + t0 = time.perf_counter() for _ in range_it: mydict['0'] @@ -18,7 +19,7 @@ def bench_dict(loops, mydict): mydict['800'] mydict['900'] - return pyperf.perf_counter() - t0 + return time.perf_counter() - t0 runner = pyperf.Runner()