Add function calls to understand detached results.

This commit is contained in:
Bill Thiede 2019-10-24 14:08:03 -07:00
parent b280b11480
commit 626cfe01bb
2 changed files with 28 additions and 2 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -48,9 +48,34 @@ fn four(runtime: Duration) {
} }
} }
#[inline(never)]
fn first(runtime: Duration) {
println!("Starting first");
let start = Instant::now();
loop {
let diff = Instant::now() - start;
if diff > runtime {
return;
}
}
}
#[inline(never)]
fn last(runtime: Duration) {
println!("Starting last");
let start = Instant::now();
loop {
let diff = Instant::now() - start;
if diff > runtime {
return;
}
}
}
fn main() { fn main() {
let runtime = Duration::new(2, 0); let runtime = Duration::new(2, 0);
first(runtime);
four(runtime); four(runtime);
three(runtime); three(runtime);
two(runtime); two(runtime);
@ -61,4 +86,5 @@ fn main() {
three(runtime); three(runtime);
one(runtime); one(runtime);
four(runtime); four(runtime);
last(runtime);
} }