File tree 2 files changed +3
-0
lines changed
bindings/python/google_benchmark
2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ def my_benchmark(state):
26
26
if __name__ == '__main__':
27
27
benchmark.main()
28
28
"""
29
+ import atexit
29
30
30
31
from absl import app
31
32
from google_benchmark import _benchmark
@@ -158,3 +159,4 @@ def main(argv=None):
158
159
# Methods for use with custom main function.
159
160
initialize = _benchmark .Initialize
160
161
run_benchmarks = _benchmark .RunSpecifiedBenchmarks
162
+ atexit .register (_benchmark .ClearRegisteredBenchmarks )
Original file line number Diff line number Diff line change @@ -179,5 +179,6 @@ PYBIND11_MODULE(_benchmark, m) {
179
179
py::return_value_policy::reference);
180
180
m.def (" RunSpecifiedBenchmarks" ,
181
181
[]() { benchmark::RunSpecifiedBenchmarks (); });
182
+ m.def (" ClearRegisteredBenchmarks" , benchmark::ClearRegisteredBenchmarks);
182
183
};
183
184
} // namespace
You can’t perform that action at this time.
0 commit comments