Skip to content

Comments

Demonstration of printing elapsed time for every exec()#923

Merged
tskisner merged 3 commits intotoast3from
operator_timer
Feb 20, 2026
Merged

Demonstration of printing elapsed time for every exec()#923
tskisner merged 3 commits intotoast3from
operator_timer

Conversation

@tskisner
Copy link
Member

No description provided.

@tskisner
Copy link
Member Author

With most recent commit, an example of what is printed when the timing trait is enabled:

polyfilter = ops.PolyFilter(
    name="custom_poly1D_name",
    timing=True,
)
polyfilter.apply(data)

Output:

TOAST INFO: Begin custom_poly1D_name (PolyFilter) exec()
TOAST INFO: End custom_poly1D_name (PolyFilter) exec() in 0.01 s
TOAST INFO: Begin custom_poly1D_name (PolyFilter) finalize()
TOAST INFO: End custom_poly1D_name (PolyFilter) finalize() in 0.00 s

@tskisner tskisner marked this pull request as ready for review February 19, 2026 21:06
Copy link
Member

@keskitalo keskitalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this. Only one question: should finalize() also report the time sense the first call to exec()?

@tskisner
Copy link
Member Author

Based on offline discussion, most recent commit just prints one message at the start of first call to exec() and then the timing at the end of finalize():

TOAST INFO: custom_poly1D_name (PolyFilter) starting...
TOAST INFO: custom_poly1D_name (PolyFilter) applied in 0.01 s

@tskisner tskisner merged commit 119b9ab into toast3 Feb 20, 2026
7 checks passed
@tskisner tskisner deleted the operator_timer branch February 20, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants