forked from mkhan45/RustScript
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBench.java
More file actions
Latest commit
22 lines (20 loc) · 615 Bytes
/
Copy pathBench.java
File metadata and controls
22 lines (20 loc) · 615 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
importcore.Interpreter;
publicclassBench {
publicstaticvoidmain(String[] args) throwsException {
Interpreteri = newInterpreter();
try {
i.execute(
"let ack = fn (m, n) => if (m == 0) then (n + 1) else (if (n == 0) then (ack(m - 1, 1)) else (ack(m - 1, ack(m, n - 1))))");
} catch (Exceptione) {
System.out.println(e.getMessage());
}
longt1 = System.currentTimeMillis();
try {
i.execute("ack(3, 8)");
} catch (Exceptione) {
System.out.println(e.getMessage());
}
longt2 = System.currentTimeMillis();
System.out.println(String.format("Time: %d ms", t2 - t1));
}
}