mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 09:24:26 +03:00
woops, headless crate didnt have the fix to toggle off cpuprofiler by default
This commit is contained in:
parent
0d27a11b2b
commit
a45b393b0d
@ -4,9 +4,13 @@ version = "0.1.0"
|
|||||||
authors = ["Dustin Carlino <dabreegster@gmail.com>"]
|
authors = ["Dustin Carlino <dabreegster@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = []
|
||||||
|
profiler = ["cpuprofiler"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
abstutil = { path = "../abstutil" }
|
abstutil = { path = "../abstutil" }
|
||||||
cpuprofiler = "0.0.3"
|
cpuprofiler = { version = "0.0.3", optional = true }
|
||||||
geom = { path = "../geom" }
|
geom = { path = "../geom" }
|
||||||
map_model = { path = "../map_model" }
|
map_model = { path = "../map_model" }
|
||||||
sim = { path = "../sim" }
|
sim = { path = "../sim" }
|
||||||
|
@ -29,11 +29,14 @@ fn main() {
|
|||||||
timer.done();
|
timer.done();
|
||||||
|
|
||||||
if enable_profiler {
|
if enable_profiler {
|
||||||
cpuprofiler::PROFILER
|
#[cfg(feature = "profiler")]
|
||||||
.lock()
|
{
|
||||||
.unwrap()
|
cpuprofiler::PROFILER
|
||||||
.start("./profile")
|
.lock()
|
||||||
.unwrap();
|
.unwrap()
|
||||||
|
.start("./profile")
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let timer = Timer::new("run sim until done");
|
let timer = Timer::new("run sim until done");
|
||||||
sim.run_until_done(
|
sim.run_until_done(
|
||||||
@ -44,7 +47,10 @@ fn main() {
|
|||||||
sim.save();
|
sim.save();
|
||||||
// Some simulations run for a really long time, just do this.
|
// Some simulations run for a really long time, just do this.
|
||||||
if enable_profiler {
|
if enable_profiler {
|
||||||
cpuprofiler::PROFILER.lock().unwrap().stop().unwrap();
|
#[cfg(feature = "profiler")]
|
||||||
|
{
|
||||||
|
cpuprofiler::PROFILER.lock().unwrap().stop().unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if paranoia {
|
if paranoia {
|
||||||
@ -56,6 +62,9 @@ fn main() {
|
|||||||
timer.done();
|
timer.done();
|
||||||
println!("Done at {}", sim.time());
|
println!("Done at {}", sim.time());
|
||||||
if enable_profiler && save_at.is_none() {
|
if enable_profiler && save_at.is_none() {
|
||||||
cpuprofiler::PROFILER.lock().unwrap().stop().unwrap();
|
#[cfg(feature = "profiler")]
|
||||||
|
{
|
||||||
|
cpuprofiler::PROFILER.lock().unwrap().stop().unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user