mirror of
https://github.com/Noratrieb/brainfuck.git
synced 2026-01-14 21:35:02 +01:00
release
This commit is contained in:
parent
3d565765d8
commit
6d7205bc4b
1 changed files with 13 additions and 7 deletions
|
|
@ -13,20 +13,26 @@ fn main() {
|
|||
return;
|
||||
}
|
||||
};
|
||||
let program = match fs::read_to_string(path) {
|
||||
Ok(p) => p,
|
||||
Err(e) => {
|
||||
println!("Error reading file: {}", e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
run(path);
|
||||
run(program);
|
||||
}
|
||||
|
||||
fn run(path: String) {
|
||||
println!("Path: {}", path);
|
||||
let program = fs::read_to_string(path).unwrap();
|
||||
|
||||
/* let start1 = SystemTime::now();
|
||||
fn run(program: String) {
|
||||
/*
|
||||
let start1 = SystemTime::now();
|
||||
let out = interpreter::o1::run(&*program);
|
||||
let end1 = start1.elapsed().unwrap();*/
|
||||
let start2 = SystemTime::now();
|
||||
let out2 = interpreter::o2::run(&*program).unwrap();
|
||||
let end2 = start2.elapsed().unwrap();
|
||||
//assert_eq!(out, out2);
|
||||
println!("{}\nFinished execution. Took o1: 18008ms (for hanoi), o2: {}ms", out2/*, end1.as_millis()*/, end2.as_millis());
|
||||
//println!("{}\nFinished execution. Took o1: 18008ms (for hanoi), o2: {}ms", out2/*, end1.as_millis()*/, end2.as_millis());
|
||||
println!("{}\nFinished execution. Took {}ms", out2/*, end1.as_millis()*/, end2.as_millis());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue