mirror of https://github.com/google/benchmark.git
run ClearRegisteredBenchmarks at exit (#1463)
This commit is contained in:
parent
a476d0fd8e
commit
af32e3fe1a
|
@ -26,6 +26,7 @@ Example usage:
|
|||
if __name__ == '__main__':
|
||||
benchmark.main()
|
||||
"""
|
||||
import atexit
|
||||
|
||||
from absl import app
|
||||
from google_benchmark import _benchmark
|
||||
|
@ -158,3 +159,4 @@ def main(argv=None):
|
|||
# Methods for use with custom main function.
|
||||
initialize = _benchmark.Initialize
|
||||
run_benchmarks = _benchmark.RunSpecifiedBenchmarks
|
||||
atexit.register(_benchmark.ClearRegisteredBenchmarks)
|
||||
|
|
|
@ -179,5 +179,6 @@ PYBIND11_MODULE(_benchmark, m) {
|
|||
py::return_value_policy::reference);
|
||||
m.def("RunSpecifiedBenchmarks",
|
||||
[]() { benchmark::RunSpecifiedBenchmarks(); });
|
||||
m.def("ClearRegisteredBenchmarks", benchmark::ClearRegisteredBenchmarks);
|
||||
};
|
||||
} // namespace
|
||||
|
|
Loading…
Reference in New Issue