We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2514bf commit 14a6dd7Copy full SHA for 14a6dd7
src/libstd/time/duration.rs
@@ -141,7 +141,9 @@ impl Duration {
141
/// ```
142
#[unstable(feature = "duration_as_millis", issue = "0")]
143
#[inline]
144
- pub fn as_millis(&self) -> u64 { self.secs * 1000 + self.nanos as u64 / 1_000_000 }
+ pub fn as_millis(&self) -> u64 {
145
+ self.secs * MILLIS_PER_SEC + (self.nanos / NANOS_PER_MILLI) as u64
146
+ }
147
148
/// Returns the nanosecond precision represented by this `Duration`.
149
///
0 commit comments