import { isWindows } from "../../_util/os.ts";import { nextTick as _nextTick } from "../_next_tick.ts";import { _exiting } from "./exiting.ts";
function _arch(): string { if (Deno.build.arch == "x86_64") { return "x64"; } else if (Deno.build.arch == "aarch64") { return "arm64"; } else { throw Error("unreachable"); }}
export const arch = _arch();
export const chdir = Deno.chdir;
export const cwd = Deno.cwd;
export const nextTick = _nextTick;
export const env: Record<string, string> = new Proxy({}, { get(_target, prop) { return Deno.env.get(String(prop)); }, ownKeys: () => Reflect.ownKeys(Deno.env.toObject()), getOwnPropertyDescriptor: (_target, name) => { const e = Deno.env.toObject(); if (name in Deno.env.toObject()) { const o = { enumerable: true, configurable: true }; if (typeof name === "string") { o.value = e[name]; } return o; } }, set(_target, prop, value) { Deno.env.set(String(prop), String(value)); return value; },});
export const pid = Deno.pid;
export const platform = isWindows ? "win32" : Deno.build.os;
export const version = "v16.11.1";
export const versions = { node: "16.11.1", uv: "1.42.0", zlib: "1.2.11", brotli: "1.0.9", ares: "1.17.2", modules: "93", nghttp2: "1.45.1", napi: "8", llhttp: "6.0.4", openssl: "1.1.1l", cldr: "39.0", icu: "69.1", tz: "2021a", unicode: "13.0", ...Deno.version,};
function hrtime(time?: [number, number]): [number, number] { const milli = performance.now(); const sec = Math.floor(milli / 1000); const nano = Math.floor(milli * 1_000_000 - sec * 1_000_000_000); if (!time) { return [sec, nano]; } const [prevSec, prevNano] = time; return [sec - prevSec, nano - prevNano];}
hrtime.bigint = function (): BigInt { const [sec, nano] = hrtime(); return BigInt(sec) * 1_000_000_000n + BigInt(nano);};
function memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; external: number; arrayBuffers: number;} { return { ...Deno.memoryUsage(), arrayBuffers: 0, };}
memoryUsage.rss = function (): number { return memoryUsage().rss;};