Struct kernel::common::time::Duration [] [src]

pub struct Duration {
    pub secs: i64,
    pub nanos: i32,
}

A duration

Fields

secs

The seconds

nanos

The nano seconds

Methods

impl Duration

fn new(secs: i64, nanos: i32) -> Self

Create a new duration

fn monotonic() -> Self

Get the current duration

fn realtime() -> Self

Get the realtime

fn sleep(&self)

Sleep the duration

Trait Implementations

impl Add for Duration

type Output = Duration

fn add(self, other: Self) -> Self

impl Sub for Duration

type Output = Duration

fn sub(self, other: Self) -> Self

impl PartialEq for Duration

fn eq(&self, other: &Self) -> bool

fn ne(&self, other: &Rhs) -> bool

impl PartialOrd for Duration

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

fn lt(&self, other: &Rhs) -> bool

fn le(&self, other: &Rhs) -> bool

fn gt(&self, other: &Rhs) -> bool

fn ge(&self, other: &Rhs) -> bool

Derived Implementations

impl Clone for Duration

fn clone(&self) -> Duration

fn clone_from(&mut self, source: &Self)

impl Copy for Duration