]> git.lizzy.rs Git - rust.git/commit
auto merge of #16573 : ruud-v-a/rust/timespec-arithmetic, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 19 Aug 2014 04:56:10 +0000 (04:56 +0000)
committerbors <bors@rust-lang.org>
Tue, 19 Aug 2014 04:56:10 +0000 (04:56 +0000)
commitdee8313364185046670044f2f9faa0561166f882
tree439737d38a93ad125582f4d76702e191793cb9cc
parenteaf810a219b136fff67e75840ad3c5efde9ae1e5
parent62b1fbe7de981a75ea96a9522a6d671eb75b114a
auto merge of #16573 : ruud-v-a/rust/timespec-arithmetic, r=alexcrichton

This implements `Add` and `Sub` for `Timespec`, which enables `Timespec` to be used as a time span. For example:

```rust
let begin = get_time();
// Do some stuff.
let end = get_time();
let delta = end - begin;
println!("Doing stuff took {}.{:09d} seconds.", delta.sec, delta.nsec);
```
This resolves one of the points mentioned in #2153.