Created
December 8, 2019 08:42
-
-
Save 0e4ef622/ce6aed8633216f118fe84b7e01b44ce2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(test)] | |
include!("../src/solution.rs"); | |
extern crate test; | |
const INPUT: &'static str = include_str!("../in"); | |
use criterion::{criterion_group, criterion_main, Criterion}; | |
fn criterion_benchmark(c: &mut Criterion) { | |
c.bench_function("p1_me", |b| b.iter(|| part1(INPUT))); | |
c.bench_function("p2_me", |b| b.iter(|| part2(INPUT))); | |
} | |
criterion_group!( | |
name = benches; | |
config = Criterion::default().sample_size(100); | |
targets = criterion_benchmark | |
); | |
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "day7" | |
version = "0.1.0" | |
authors = ["Matthew Tran <[email protected]>"] | |
edition = "2018" | |
[dev-dependencies] | |
criterion = "*" | |
[[bench]] | |
name = "bench" | |
harness = false | |
[dependencies] | |
# intcode library | |
# ic = { path = "../ic" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::Read; | |
mod solution; | |
// const INPUT: &'static str = include_str!("../in"); | |
fn main() { | |
let mut input = String::new(); | |
std::io::stdin().read_to_string(&mut input); | |
let p1 = solution::part1(&input); | |
println!("part 1: {}", p1); | |
let p2 = solution::part2(&input); | |
println!("part 2: {}", p2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn part1(input: &str) -> impl Display { | |
} | |
pub fn part2(input: &str) -> impl Display { | |
0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment