summaryrefslogtreecommitdiff
path: root/runtime/js/30_os.js
diff options
context:
space:
mode:
authorKamil Ogórek <kamil.ogorek@gmail.com>2022-12-27 00:16:12 +0100
committerGitHub <noreply@github.com>2022-12-27 00:16:12 +0100
commit7ce2b58bcf412924464578f3469c210b34894c8b (patch)
tree571ef978ec8ff59bc2f3c229ea44b0786251e6b9 /runtime/js/30_os.js
parenta67fd3e23e6965ce0bf25e19e5467bc5cc538d23 (diff)
feat(unstable): Add "Deno.osUptime()" API (#17179)
This PR adds support for `Deno.osUptime` which reports number of seconds since os was booted. It will allow us to be compatible with Node's `os.uptime` - https://nodejs.org/api/os.html#osuptime Partially based on https://docs.rs/uptime_lib/latest/src/uptime_lib/lib.rs.html
Diffstat (limited to 'runtime/js/30_os.js')
-rw-r--r--runtime/js/30_os.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/js/30_os.js b/runtime/js/30_os.js
index 723b52132..3c9768593 100644
--- a/runtime/js/30_os.js
+++ b/runtime/js/30_os.js
@@ -25,6 +25,10 @@
return ops.op_os_release();
}
+ function osUptime() {
+ return ops.op_os_uptime();
+ }
+
function systemMemoryInfo() {
return ops.op_system_memory_info();
}
@@ -106,6 +110,7 @@
loadavg,
networkInterfaces,
osRelease,
+ osUptime,
setExitHandler,
systemMemoryInfo,
uid,