mirror of
https://github.com/Noratrieb/brainfuck.git
synced 2026-01-16 14:25:03 +01:00
doc comments and further testing
This commit is contained in:
parent
5b9dd9ca67
commit
248d07e317
5 changed files with 727 additions and 164 deletions
|
|
@ -20,16 +20,13 @@ fn main() {
|
|||
fn run(path: String) {
|
||||
println!("Path: {}", path);
|
||||
let program = fs::read_to_string(path).unwrap();
|
||||
let start0 = SystemTime::now();
|
||||
let out0 = interpreter::o0::run(&*program);
|
||||
let end0 = start0.elapsed().unwrap();
|
||||
let start1 = SystemTime::now();
|
||||
|
||||
/* let start1 = SystemTime::now();
|
||||
let out = interpreter::o1::run(&*program);
|
||||
let end1 = start1.elapsed().unwrap();
|
||||
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);
|
||||
assert_eq!(out0, out2);
|
||||
println!("{}\nFinished execution. Took o0: {}ms, o1: {}ms, o2: {}ms", out, end0.as_millis(), end1.as_millis(), end2.as_millis());
|
||||
//assert_eq!(out, out2);
|
||||
println!("{}\nFinished execution. Took o1: 18008ms (for hanoi), o2: {}ms", out2/*, end1.as_millis()*/, end2.as_millis());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue