feat: move OS.clock to IO.clock and remove deprecated os_clock native

Migrate the clock timing functionality from the OS class to the IO class across all benchmark scripts and the core library. Remove the os_clock native function and its associated OS class definition from wren_core.c, while adding a new ioClock native in wren_io.c that uses the same clock()/CLOCKS_PER_SEC logic. Update all benchmark files (binary_trees, fib, for, method_call) to reference IO.clock instead of OS.clock for both start time and elapsed time calculations.
This commit is contained in:
Bob Nystrom
2014-02-04 16:49:16 +00:00
parent 15958938f4
commit dbf0131776
6 changed files with 17 additions and 20 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ class NthToggle is Toggle {
}
}
var start = OS.clock
var start = IO.clock
var n = 100000
var val = true
var toggle = new Toggle(val)
@@ -66,4 +66,4 @@ for (i in 0...n) {
IO.print(ntoggle.value)
IO.print("elapsed: " + (OS.clock - start).toString)
IO.print("elapsed: " + (IO.clock - start).toString)