diff options
author | Kamil Ogórek <kamil.ogorek@gmail.com> | 2022-12-27 00:16:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-27 00:16:12 +0100 |
commit | 7ce2b58bcf412924464578f3469c210b34894c8b (patch) | |
tree | 571ef978ec8ff59bc2f3c229ea44b0786251e6b9 /cli/tsc/dts/lib.deno.unstable.d.ts | |
parent | a67fd3e23e6965ce0bf25e19e5467bc5cc538d23 (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 'cli/tsc/dts/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/tsc/dts/lib.deno.unstable.d.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index f1b8d99e9..77d350503 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1691,6 +1691,21 @@ declare namespace Deno { /** The buffered output from the child process' `stderr`. */ readonly stderr: Uint8Array; } + + /** **UNSTABLE**: New API, yet to be vetted. + * + * Returns the Operating System uptime in number of seconds. + * + * ```ts + * console.log(Deno.osUptime()); + * ``` + * + * Requires `allow-sys` permission. + * + * @tags allow-sys + * @category Runtime Environment + */ + export function osUptime(): number; } /** **UNSTABLE**: New API, yet to be vetted. |