Created
December 31, 2018 22:27
-
-
Save bearcage/c8e6082e47819fb35b09504ff7b7fe99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\Users\aberg\work\timetest (master -> origin) | |
| λ cargo run | |
| Finished dev [unoptimized + debuginfo] target(s) in 0.02s | |
| Running `target\debug\timetest.exe` | |
| thread 'main' panicked at 'assertion failed: `(left == right)` | |
| left: `4.999914ms`, | |
| right: `5ms`', src\main.rs:6:5 | |
| note: Run with `RUST_BACKTRACE=1` for a backtrace. | |
| error: process didn't exit successfully: `target\debug\timetest.exe` (exit code: 101) | |
| C:\Users\aberg\work\timetest (master -> origin) | |
| λ cat src\main.rs | |
| 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