Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Nov 20, 2019
1 parent 9b4d979 commit be99e50
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions rayon-demo/src/life/mod.rs
Expand Up @@ -250,9 +250,10 @@ fn measure_cpu(f: fn(Board, usize, u64) -> (), args: &Args) -> CpuResult {
let interval = 1_000_000_000 / rate as u64;
let brd = Board::new(n, n).random();

let CpuMeasure { time_duration, cpu_usage_percent } = cpu_time::measure_cpu(|| {
f(brd, gens, interval)
});
let CpuMeasure {
time_duration,
cpu_usage_percent,
} = cpu_time::measure_cpu(|| f(brd, gens, interval));

CpuResult {
actual_fps: (1_000_000_000.0 * gens as f64) / time_duration as f64,
Expand Down
7 changes: 5 additions & 2 deletions rayon-demo/src/noop/mod.rs
Expand Up @@ -25,9 +25,12 @@ pub fn main(args: &[String]) {
let m = cpu_time::measure_cpu(|| {
for _ in 1..args.flag_iters {
std::thread::sleep(std::time::Duration::from_millis(args.flag_sleep));
rayon::spawn(move || { } );
rayon::spawn(move || {});
}
});
println!("noop --iters={} --sleep={}", args.flag_iters, args.flag_sleep);
println!(
"noop --iters={} --sleep={}",
args.flag_iters, args.flag_sleep
);
cpu_time::print_time(m);
}

0 comments on commit be99e50

Please sign in to comment.