doc comments and further testing

This commit is contained in:
nora 2021-04-24 15:20:18 +02:00
parent 5b9dd9ca67
commit 248d07e317
5 changed files with 727 additions and 164 deletions

View file

@ -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());
}