-
Notifications
You must be signed in to change notification settings - Fork 119
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
Exception raise ZeroDivisionError #100
Comments
I can't reproduce this bug. Can you provide an example of a function that does nothing, and which OS ou use ? I tried : @profile
def dummy1():
pass
@profile
def dummy2():
"""docstring"""
@profile
def dummy3():
return But all of them give me non-zero time for the last line. I tried on Windows with python3.9. |
Update: I got the problem while running tests in Linux in Nodd/lineprofilergui@09ed262. Maybe it has something to do with timer precision. |
@Nodd Can you make a PR with logic to handle this case? |
Sure, that was my intention. |
Sorry for the delay, Nodd.
|
I would personally go for NaN, but either solution sounds fine to me. |
percent=0 stands for "function ran in 0% of total_time". NaN could be more for "profiled function" unused in code (I do not know if it is possible). |
Hi,
Exception is raised if profiled function do nothing (just pass). I agree that function useless should not be present or profile.
But if you decide to profile in a single shoot a lot of functions, some stub function may be present in package.
with that part of code :
Thanks for that package :-)
MadRabbit
The text was updated successfully, but these errors were encountered: