rstd 0.1.0
Loading...
Searching...
No Matches
rstd::time::Instant Struct Referenceexport
module rstd

A measurement of a monotonically nondecreasing clock. More...

Public Member Functions

auto elapsed () const noexcept -> Duration
 Returns the amount of time elapsed since this instant was created.
 
auto duration_since (Instant other) const noexcept -> Duration
 Returns the amount of time elapsed from another instant to this one.
 
auto checked_add (Duration dur) const noexcept -> Option< Instant >
 Returns Some(instant) if the addition does not overflow, or None otherwise.
 
auto checked_sub (Duration dur) const noexcept -> Option< Instant >
 Returns Some(instant) if the subtraction does not underflow, or None otherwise.
 

Static Public Member Functions

static auto now () noexcept -> Instant
 Returns an instant corresponding to "now".
 

Detailed Description

A measurement of a monotonically nondecreasing clock.

Member Function Documentation

◆ checked_add()

auto rstd::time::Instant::checked_add ( Duration dur) const -> Option<Instant>
inlineexportnoexcept

Returns Some(instant) if the addition does not overflow, or None otherwise.

Parameters
durThe duration to add.

◆ checked_sub()

auto rstd::time::Instant::checked_sub ( Duration dur) const -> Option<Instant>
inlineexportnoexcept

Returns Some(instant) if the subtraction does not underflow, or None otherwise.

Parameters
durThe duration to subtract.

◆ duration_since()

auto rstd::time::Instant::duration_since ( Instant other) const -> Duration
inlineexportnoexcept

Returns the amount of time elapsed from another instant to this one.

Parameters
otherThe earlier instant.
Returns
The duration between the two instants.

The documentation for this struct was generated from the following file: