Skip to content

Instantly share code, notes, and snippets.

@0e4ef622
Created December 8, 2019 08:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0e4ef622/ce6aed8633216f118fe84b7e01b44ce2 to your computer and use it in GitHub Desktop.
Save 0e4ef622/ce6aed8633216f118fe84b7e01b44ce2 to your computer and use it in GitHub Desktop.
#![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);
[package]
name = "day7"
version = "0.1.0"
authors = ["Matthew Tran <0e4ef622@gmail.com>"]
edition = "2018"
[dev-dependencies]
criterion = "*"
[[bench]]
name = "bench"
harness = false
[dependencies]
# intcode library
# ic = { path = "../ic" }
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);
}
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