pytimings.timer¶
Main module.
Module Contents¶
Classes¶
Functions¶
|
Start timer on entering block scope, stop it (and optionally output) on exiting. |
|
Start timer on entering block scope, stop it (and optionally output) on exiting. |
|
Attributes¶
- exception pytimings.timer.NoTimerError(section, timings=None, is_unstopped=False)[source]¶
Bases:
ExceptionCommon base class for all non-exit exceptions.
- class pytimings.timer.Timings[source]¶
- _commited_deltas: dict[str, TimingDelta][source]¶
- _known_timers_map: dict[str, tuple[bool, TimingData | None]][source]¶
- stop(section_name: str | None = None) int[source]¶
stop named section’s counter or all of them if section_name is None
- reset(section_name: str | None = None) None[source]¶
set elapsed time back to 0 for a given section or all of them if section_name is None
- output_files(output_dir: pathlib.Path, csv_base: str) pathlib.Path[source]¶
output all recorded measures to a csv file
- pytimings.timer.scoped_timing(section_name, log_function=None, timings=None, format='')[source]¶
Start timer on entering block scope, stop it (and optionally output) on exiting.
The printout will only show walltime for the current scope. See
pytimings.timer.cummulative_scoped_timing()for a version with cummulative output.
- pytimings.timer.cummulative_scoped_timing(section_name, log_function=None, timings=None, format='')[source]¶
Start timer on entering block scope, stop it (and optionally output) on exiting.
The printout will show the cummulated walltime for all scopes with this section name. See
pytimings.timer.scoped_timing()for a version with non-cummulative output.