Skip to content

Document rounding down in std::time::Durations's subsec_millis etc. #52372

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

Merged
merged 1 commit into from
Jul 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/libcore/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl Duration {
#[inline]
pub const fn as_secs(&self) -> u64 { self.secs }

/// Returns the fractional part of this `Duration`, in milliseconds.
/// Returns the fractional part of this `Duration`, in whole milliseconds.
///
/// This method does **not** return the length of the duration when
/// represented by milliseconds. The returned number always represents a
Expand All @@ -228,7 +228,7 @@ impl Duration {
#[inline]
pub const fn subsec_millis(&self) -> u32 { self.nanos / NANOS_PER_MILLI }

/// Returns the fractional part of this `Duration`, in microseconds.
/// Returns the fractional part of this `Duration`, in whole microseconds.
///
/// This method does **not** return the length of the duration when
/// represented by microseconds. The returned number always represents a
Expand Down Expand Up @@ -268,7 +268,7 @@ impl Duration {
#[inline]
pub const fn subsec_nanos(&self) -> u32 { self.nanos }

/// Returns the total number of milliseconds contained by this `Duration`.
/// Returns the total number of whole milliseconds contained by this `Duration`.
///
/// # Examples
///
Expand All @@ -285,7 +285,7 @@ impl Duration {
self.secs as u128 * MILLIS_PER_SEC as u128 + (self.nanos / NANOS_PER_MILLI) as u128
}

/// Returns the total number of microseconds contained by this `Duration`.
/// Returns the total number of whole microseconds contained by this `Duration`.
///
/// # Examples
///
Expand Down