From 73263772ca4a811be5e448c45f3b3dbd4d760723 Mon Sep 17 00:00:00 2001 From: unexcellent <> Date: Wed, 11 Dec 2024 14:43:34 +0100 Subject: [PATCH] test: refactor Quantitiy init bench --- benchmarking/bench_quantity.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/benchmarking/bench_quantity.py b/benchmarking/bench_quantity.py index 7cd9cd2..7ac1c5b 100644 --- a/benchmarking/bench_quantity.py +++ b/benchmarking/bench_quantity.py @@ -3,12 +3,9 @@ from quantio import Time -def init_only_base_unit(): - Time(seconds=1, milliseconds=1) - - def bench_init(benchmark): - benchmark.pedantic(init_only_base_unit, iterations=100, rounds=100) + f = lambda: Time(seconds=1, milliseconds=1) + benchmark.pedantic(f, iterations=100, rounds=100) if __name__ == "__main__":