diff --git a/core/time/time_js.odin b/core/time/time_js.odin index 932fc2b8e..c5090df90 100644 --- a/core/time/time_js.odin +++ b/core/time/time_js.odin @@ -24,9 +24,9 @@ _sleep :: proc "contextless" (d: Duration) { _tick_now :: proc "contextless" () -> Tick { foreign odin_env { - tick_now :: proc "contextless" () -> i64 --- + tick_now :: proc "contextless" () -> f32 --- } - return Tick{tick_now()*1e6} + return Tick{i64(tick_now()*1e6)} } _yield :: proc "contextless" () { diff --git a/vendor/wasm/js/runtime.js b/vendor/wasm/js/runtime.js index f5ca325f8..85be84caf 100644 --- a/vendor/wasm/js/runtime.js +++ b/vendor/wasm/js/runtime.js @@ -1335,7 +1335,7 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement) { // return a bigint to be converted to i64 time_now: () => BigInt(Date.now()), - tick_now: () => BigInt(performance.now()), + tick_now: () => performance.now(), time_sleep: (duration_ms) => { if (duration_ms > 0) { // TODO(bill): Does this even make any sense?