-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add time
method taking Duration
in Timed
trait?
#48
Comments
I hadn't thought of it but that's a great idea. Any ideas for the potential new method name in |
If you're ok with a breaking change, you could consider renaming the existing one to If not, the new one could be named |
I'd rather not make people change working code. I think |
Add a new method for recording timings using std::time::Duration instead of a u64 of milliseconds. The duration is converted to the number of milliseconds before being send to the sink. Any integer overflow will cause an error to be returned. Fixes #48
Add a new method for recording timings using std::time::Duration instead of a u64 of milliseconds. The duration is converted to the number of milliseconds before being send to the sink. Any integer overflow will cause an error to be returned. Fixes #48
Add a new method for recording timings using std::time::Duration instead of a u64 of milliseconds. The duration is converted to the number of milliseconds before being sent to the sink. Any integer overflow will cause an error to be returned. Fixes #48
Opened #55 to address this. Let me know what you think! |
Thanks for notifying, went through the change and it looks good! |
Using
time
to record a timing, I've found myself having to write this to convert aDuration
to milliseconds like this:Note that this can overflow. I decided to not care about this because this is about metrics (and if your timing overflows, your app has a bigger problem than incorrect metrics).
I wonder if you've considered adding an additional method to
Timed
that takes aDuration
instead of au64
and handles the conversion? It could returnErr
in case of overflow.The text was updated successfully, but these errors were encountered: