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
@@ -3,8 +3,8 @@ var fib = fn(n) {
return fib.call(n - 1) + fib.call(n - 2)
}
var start = OS.clock
var start = IO.clock
for (i in 1..5) {
IO.print(fib.call(28))
}
IO.print("elapsed: " + (OS.clock - start).toString)
IO.print("elapsed: " + (IO.clock - start).toString)