Struct linux_api::time::timespec [] [src]

pub struct timespec {
    pub tv_sec: time_t,
    pub tv_nsec: c_long,
}

A structure that contains the number of seconds and nanoseconds since an epoch.

If in doubt, assume we're talking about the UNIX epoch.

Fields

tv_sec: time_t

The number of seconds contained in this timespec

tv_nsec: c_long

The number of nanoseconds contained in this timespec

Methods

impl timespec
[src]

fn new() -> timespec

Creates a new timespec with both values defaulting to zero

fn from_seconds(seconds: time_t) -> timespec

Creates a new timespec from the specified number of seconds

fn clear(&mut self)

Clears this timespec, setting each value to zero

Trait Implementations

impl Copy for timespec
[src]

impl Clone for timespec
[src]

fn clone(&self) -> timespec

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for timespec
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.