Print pixel/s and ray/s at end of render.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bill Thiede 2019-10-16 21:11:40 -07:00
parent 12da8b2d16
commit af6cda7349

View File

@ -139,10 +139,10 @@ pub struct Opt {
)]
pub push_gateway: String,
/// Image width
#[structopt(short = "w", long = "width", default_value = "1024")]
#[structopt(short = "w", long = "width", default_value = "512")]
pub width: usize,
/// Image height
#[structopt(short = "h", long = "height", default_value = "1024")]
#[structopt(short = "h", long = "height", default_value = "512")]
pub height: usize,
/// Number of threads
#[structopt(short = "t", long = "num_threads")]
@ -474,6 +474,7 @@ pub fn render(scene: Scene, output_dir: &Path) -> std::result::Result<(), std::i
drop(pixel_req_rx);
drop(pixel_resp_tx);
let start_time = time::Instant::now();
let (w, h) = (scene.width, scene.height);
thread::spawn(move || {
let batch_line_requests = true;
@ -548,5 +549,16 @@ pub fn render(scene: Scene, output_dir: &Path) -> std::result::Result<(), std::i
}
}
}
let human = human::Formatter::new();
let time_diff = time::Instant::now() - start_time;
let ray_count = RAY_COUNT.load(Ordering::SeqCst);
info!(
"{} pixels {} {}s pixels/s {} rays/s",
human.format(pixel_total as f64),
time_diff.as_secs_f64(),
human.format(pixel_total as f64 / time_diff.as_secs_f64()),
human.format(ray_count as f64 / time_diff.as_secs_f64())
);
output::write_images(output_dir)
}