Skip to content

Commit 57b2067

Browse files
committed
Use NANOS_PER_SEC constant
1 parent 43baa2c commit 57b2067

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl Duration {
276276
#[unstable(feature = "duration_nanos", issue = "0")]
277277
#[inline]
278278
pub fn as_nanos(&self) -> u128 {
279-
self.secs as u128 * 1000_000_000 + self.nanos as u128
279+
self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos as u128
280280
}
281281

282282
/// Checked `Duration` addition. Computes `self + other`, returning [`None`]

0 commit comments

Comments
 (0)