-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Added an api to accept block of code and to return result and time taken to execute. #3543
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
I think we (also) probably want an API that only returns the elapsed |
I don't like how the exceptions are handled. We do not know if there was an exception or not. There is currently no difference between an exception thrown by the measured code block and an exception being returned by the same code block. I don't know what the people would prefer: let the exception pass through and get no result of a timed stopwatch, or on the contrary measure the code block and get the caught exception in a specific returned value. So I'd say this would require more API:
Anyways, this should probably be better refined. |
…,exceptuionallyTimedResult.
@kluever @ogregoire |
Looks relevant to #3528. |
public void update() { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why an empty method, () -> update()
can be replaced with () -> {}
Hi,
@kluever @kevinb9n @ogregoire
I've added an API to accept block of code and return result and time taken to execute. #3535