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
@@ -1,10 +1,10 @@
var list = []
var start = OS.clock
var start = IO.clock
for (i in 0...1000000) list.add(i)
var sum = 0
for (i in list) sum = sum + i
IO.print(sum)
IO.print("elapsed: " + (OS.clock - start).toString)
IO.print("elapsed: " + (IO.clock - start).toString)