seperate files

This commit is contained in:
nora 2021-04-24 15:06:02 +02:00
parent a421a78aa0
commit 5b9dd9ca67
5 changed files with 406 additions and 335 deletions

View file

@ -20,6 +20,9 @@ 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 out = interpreter::o1::run(&*program);
let end1 = start1.elapsed().unwrap();
@ -27,5 +30,6 @@ fn run(path: String) {
let out2 = interpreter::o2::run(&*program).unwrap();
let end2 = start2.elapsed().unwrap();
assert_eq!(out, out2);
println!("{}\nFinished execution. Took o1: {}ms, o2: {}ms", out, end1.as_millis(), end2.as_millis());
assert_eq!(out0, out2);
println!("{}\nFinished execution. Took o0: {}ms, o1: {}ms, o2: {}ms", out, end0.as_millis(), end1.as_millis(), end2.as_millis());
}