Struct

std::time::Duration

source
exposed struct Duration {
    nanoseconds: u64,
}

A span of time, in nanoseconds: up to some 584 years.

Methods

method from_nanossource

fn from_nanos(nanoseconds: u64) -> Duration { ... }

A duration of nanoseconds nanoseconds.

method from_millissource

fn from_millis(milliseconds: u64) -> Duration { ... }

A duration of milliseconds milliseconds.

method from_secssource

fn from_secs(seconds: u64) -> Duration { ... }

A duration of seconds seconds.

method as_nanossource

fn as_nanos(self) -> u64 { ... }

The whole nanoseconds.

method as_millissource

fn as_millis(self) -> u64 { ... }

The whole milliseconds.

method as_secssource

fn as_secs(self) -> u64 { ... }

The whole seconds.

method is_zerosource

fn is_zero(self) -> bool { ... }

Whether the duration is no time at all.

method addsource

fn add(self, other: Duration) -> Duration { ... }

The two durations together.

method subsource

fn sub(self, other: Duration) -> Duration { ... }

What is left of this duration after other; zero if other is longer.

method mulsource

fn mul(self, times: u64) -> Duration { ... }

The duration times times over.

Instances

instance Eq[Duration, Duration]source

instance Eq[Duration, Duration] { ... }

In std::time.

Durations are equal when they are as long.

instance Ord[Duration, Duration]source

instance Ord[Duration, Duration] { ... }

In std::time.

The shorter duration orders first.