Missed part of commit 78da1c644141e87bb47ae907ef9d80fb926c1965

This commit is contained in:
Bill Thiede 2018-09-22 12:06:08 -07:00
parent 5723b285f0
commit fedcd3792b

View File

@ -25,13 +25,16 @@ fn main() -> Result<(), std::io::Error> {
let opt = Opt::from_args();
let scene = opt.model.scene(&opt);
fs::create_dir_all(&opt.output)?;
let pprof_path = "pprof.profile";
if opt.pprof {
PROFILER.lock().unwrap().start(pprof_path).unwrap();
if let Some(ref pprof_path) = opt.pprof {
PROFILER
.lock()
.unwrap()
.start(pprof_path.to_str().unwrap().as_bytes())
.unwrap();
}
let res = render(scene, &opt.output);
if opt.pprof {
info!("Saving pprof to {}", pprof_path);
if let Some(pprof_path) = opt.pprof {
info!("Saving pprof to {}", pprof_path.to_string_lossy());
PROFILER.lock().unwrap().stop().unwrap();
}
let runtime = start.elapsed();