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:
+2
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user