pytimings.tools

Module Contents

Functions

ensure_directory_exists(→ None)

create dirname if it doesn't exist

output_at_exit(→ None)

Register output methods to be executed at Python interpreter exit

busywait(→ float)

busywait simulates load, so user time won't be 0 in timings

generate_example_data(→ list[pathlib.Path])

pytimings.tools.ensure_directory_exists(dirname: str | pathlib.Path) None[source]

create dirname if it doesn’t exist

pytimings.tools.output_at_exit(output_dir: str | pathlib.Path | None = None, csv_base: str = 'timings', timings: pytimings.timer.Timings | None = None, files: bool = True, console: bool = True) None[source]

Register output methods to be executed at Python interpreter exit

files: set to False to not write csv files to disk console: set to False to not display console output for timing sections csv_base: filename stem for csv outputs output_dir: directory for csv outputs, defaults to current working directory

pytimings.tools.busywait(secs: float) float[source]

busywait simulates load, so user time won’t be 0 in timings

pytimings.tools.generate_example_data(output_dir: str | pathlib.Path, number_of_runs: int = 10) list[pathlib.Path][source]