Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] How does @ez.timeit decorator work? #164

Open
cboulay opened this issue Dec 24, 2024 · 0 comments
Open

[docs] How does @ez.timeit decorator work? #164

cboulay opened this issue Dec 24, 2024 · 0 comments

Comments

@cboulay
Copy link
Collaborator

cboulay commented Dec 24, 2024

I tried adding it to a subscriber/publisher method but that crashed; _, task_info = self._tasks[func.__name__] doesn't work because self._tasks[func.__name__] is a single function, not a tuple. And the function doesn't have an .address so it can't be used for the fstring in the log call anyway.

If I fix the above, then the function returns immediately because it's actually returning the generator method it's wrapping.
That makes me think that it's only intended to be used in a standalone function / method that isn't called by the framework, but then I can't consolidate why it has setattr(func, TIMEIT_ATTR, True).

I'll make a separate wrapper for my own uses.

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

No branches or pull requests

1 participant