summaryrefslogtreecommitdiff
path: root/cli/rt/11_timers.js
diff options
context:
space:
mode:
authorWilliam Perron <hey@wperron.io>2020-10-15 21:06:31 -0400
committerGitHub <noreply@github.com>2020-10-15 21:06:31 -0400
commit943b0980c7ff97cb6096291efa5e3d5dbfe10805 (patch)
treed258b1c9fa317db819c3d95e6616635fd70c2489 /cli/rt/11_timers.js
parentbbe4474d39aecfabed52bd080e73d34978b6481b (diff)
feat(cli/ops): add the sleep_sync op (#7974)
Diffstat (limited to 'cli/rt/11_timers.js')
-rw-r--r--cli/rt/11_timers.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/rt/11_timers.js b/cli/rt/11_timers.js
index 8f6a7e049..c762c59d8 100644
--- a/cli/rt/11_timers.js
+++ b/cli/rt/11_timers.js
@@ -20,6 +20,10 @@
return core.jsonOpSync("op_now");
}
+ function sleepSync(millis = 0) {
+ return core.jsonOpSync("op_sleep_sync", { millis });
+ }
+
// Derived from https://github.com/vadimg/js_bintrees. MIT Licensed.
class RBNode {
@@ -545,5 +549,6 @@
opStopGlobalTimer,
opStartGlobalTimer,
opNow,
+ sleepSync,
};
})(this);