-
Notifications
You must be signed in to change notification settings - Fork 18k
time: add methods to convert duration to microseconds and milliseconds #30819
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
Conversation
The return values are integers, as opposed to floats, since the fractionals can be derived from multiplying t.Seconds(). Fixes golang#28564
This PR (HEAD: b843ab7) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/167387 to see it. Tip: You can toggle comments from me using the |
Message from Robert Griesemer: Patch Set 1: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/167387. |
Message from Gobot Gobot: Patch Set 1: TryBots beginning. Status page: https://farmer.golang.org/try?commit=1d915070 Please don’t reply on this GitHub thread. Visit golang.org/cl/167387. |
Message from Robert Griesemer: Patch Set 1: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/167387. |
Message from Gobot Gobot: Patch Set 1: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/167387. |
Message from Brad Fitzpatrick: Patch Set 1: Robert, to confirm: you're cool with int64 instead of floats? Please don’t reply on this GitHub thread. Visit golang.org/cl/167387. |
Message from Robert Griesemer: Patch Set 1:
Everything below a second is int64 now, and everything above a second is float, which seems ok to me. If one prints ms or us, it's usually whole number, not a fractional ms (otherwise, why not print a us, or use seconds). Rust also returns integers (u128) in these cases. Please don’t reply on this GitHub thread. Visit golang.org/cl/167387. |
The return values are integers, as opposed to floats, since the fractionals can be derived from multiplying t.Seconds(). Fixes #28564 Change-Id: I3796227e1f64ead39ff0aacfbdce912d952f2994 GitHub-Last-Rev: b843ab7 GitHub-Pull-Request: #30819 Reviewed-on: https://go-review.googlesource.com/c/go/+/167387 Run-TryBot: Robert Griesemer <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
This PR is being closed because golang.org/cl/167387 has been merged. |
The return values are integers, as opposed to floats, since the fractionals can be derived from multiplying t.Seconds().
Fixes #28564