feat: implement benchmarks (#30)

This commit is contained in:
Felix Spöttel
2023-10-21 21:08:46 +02:00
committed by GitHub
parent d10ec0573e
commit 70dac9329f
21 changed files with 993 additions and 567 deletions

View File

@@ -0,0 +1,31 @@
use std::process::{Command, Stdio};
pub fn solve_handler(day: u8, release: bool, time: bool, submit_part: Option<u8>) {
let day_padded = format!("{:02}", day);
let mut cmd_args = vec!["run".to_string(), "--bin".to_string(), day_padded];
if release {
cmd_args.push("--release".to_string());
}
cmd_args.push("--".to_string());
if let Some(submit_part) = submit_part {
cmd_args.push("--submit".to_string());
cmd_args.push(submit_part.to_string())
}
if time {
cmd_args.push("--time".to_string());
}
let mut cmd = Command::new("cargo")
.args(&cmd_args)
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.spawn()
.unwrap();
cmd.wait().unwrap();
}