Add function calls to understand detached results.
This commit is contained in:
parent
b280b11480
commit
626cfe01bb
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 60 KiB |
26
src/main.rs
26
src/main.rs
@ -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() {
|
||||
let runtime = Duration::new(2, 0);
|
||||
|
||||
first(runtime);
|
||||
four(runtime);
|
||||
three(runtime);
|
||||
two(runtime);
|
||||
@ -61,4 +86,5 @@ fn main() {
|
||||
three(runtime);
|
||||
one(runtime);
|
||||
four(runtime);
|
||||
last(runtime);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user