NullTimeKeeper
This class provides a no-op implementation of a time-tracking interface, allowing for timing operations to be bypassed without changing calling code. It features a context manager that performs no timing actions and a results method that produces no output.
Methods
timed()
@classmethod
def timed(
name: str
) - > Iterator[None]
Provides a no-op context manager for timing blocks of code, allowing for consistent API usage when performance tracking is disabled.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The identifier for the code block being timed, used for compatibility with active time keepers. |
Returns
| Type | Description |
|---|---|
Iterator[None] | A context manager that yields control back to the caller without performing any timing operations. |
print_results()
@classmethod
def print_results() - > None
Executes a no-op operation for printing timing statistics, ensuring no output is generated when timing is inactive.
Returns
| Type | Description |
|---|---|
None | Nothing is returned. |