water 0.2.8-alpha

A Rust library that provides a thread-safe distributed message sending facility supporting synchronous and asynchronous I/O.
1
2
3
4
5
6
7
8
9
10
11
use time::Timespec;

pub fn add(a: Timespec, b: Timespec) -> Timespec {
    let nsec = a.nsec as i64 + b.nsec as i64;
    let sectoadd = nsec / 1000000000i64;

    Timespec {
        sec:    sectoadd + a.sec + b.sec,
        nsec:   (nsec - (sectoadd * 1000000000i64)) as i32,
    }
}