Add benchmark button to UI
The benchmark button is only enabled in release builds. If clicked, it will trigger the benchmark suite.
This commit is contained in:
+12
@@ -397,6 +397,18 @@ impl eframe::App for CompilerApp {
|
||||
{
|
||||
self.run_all_tests();
|
||||
}
|
||||
|
||||
ui.separator();
|
||||
|
||||
let is_debug = cfg!(debug_assertions);
|
||||
ui.add_enabled_ui(!is_debug, |ui| {
|
||||
let bench_btn = ui.button("⏱ Bench");
|
||||
if is_debug {
|
||||
bench_btn.on_hover_text("Benchmarks are only available in Release builds.");
|
||||
} else if bench_btn.clicked() {
|
||||
self.run_benchmarks(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
ui.add_space(2.0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user