mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 03:40:08 +00:00
Update time procedures for js targets
This commit is contained in:
Vendored
+10
@@ -1280,8 +1280,18 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement) {
|
||||
evaluate: (str_ptr, str_len) => { eval.call(null, wasmMemoryInterface.loadString(str_ptr, str_len)); },
|
||||
|
||||
time_now: () => {
|
||||
// convert ms to ns
|
||||
return Date.now() * 1e6;
|
||||
},
|
||||
time_tick_now: () => {
|
||||
// convert ms to ns
|
||||
return performance.now() * 1e6;
|
||||
},
|
||||
time_sleep: (duration_ms) => {
|
||||
if (duration_ms > 0) {
|
||||
// TODO(bill): Does this even make any sense?
|
||||
}
|
||||
},
|
||||
|
||||
sqrt: (x) => Math.sqrt(x),
|
||||
sin: (x) => Math.sin(x),
|
||||
|
||||
Reference in New Issue
Block a user