Skip to content

Instantly share code, notes, and snippets.

@bearcage
Created December 31, 2018 22:35
Show Gist options
  • Save bearcage/f30482932e236c2572dc50803ed9bffd to your computer and use it in GitHub Desktop.
Save bearcage/f30482932e236c2572dc50803ed9bffd to your computer and use it in GitHub Desktop.
use std::time::{Duration, Instant};
fn main() {
let now = Instant::now();
let offset = Duration::from_millis(5);
assert_eq!((now + offset) - now, (now - now) + offset);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment