Execute benchmark commands
(
commands: Vec<BenchmarkCommand>,
measurement_mode: Option<MeasurementMode>,
)
| 60 | |
| 61 | /// Execute benchmark commands |
| 62 | pub fn execute_benchmarks( |
| 63 | commands: Vec<BenchmarkCommand>, |
| 64 | measurement_mode: Option<MeasurementMode>, |
| 65 | ) -> Result<()> { |
| 66 | let measurement_mode = measurement_mode.unwrap_or(MeasurementMode::Walltime); |
| 67 | // SAFETY: exec-harness is single-threaded here. No thread has been spawned |
| 68 | // yet and InstrumentHooks is only created later, inside `perform`. |
| 69 | unsafe { runtime_env::apply(measurement_mode)? }; |
| 70 | |
| 71 | match measurement_mode { |
| 72 | MeasurementMode::Walltime => walltime::perform(commands), |
| 73 | MeasurementMode::Memory | MeasurementMode::Simulation | MeasurementMode::Telemetry => { |
| 74 | analysis::perform(commands) |
| 75 | } |
| 76 | } |
| 77 | } |