summaryrefslogtreecommitdiff
path: root/cli/dts/lib.deno.unstable.d.ts
diff options
context:
space:
mode:
authorElias Sjögreen <eliassjogreen1@gmail.com>2020-10-26 15:54:27 +0100
committerGitHub <noreply@github.com>2020-10-26 10:54:27 -0400
commit305a9c04ba60630f9708b681cfebb522a6110cc3 (patch)
tree36761c300215f1674c0ad2865f19538d88ec129e /cli/dts/lib.deno.unstable.d.ts
parentd52fb903cda4c30bb1673260c673ba27167ab7b1 (diff)
feat(unstable): add Deno.systemCpuInfo() (#7774)
Diffstat (limited to 'cli/dts/lib.deno.unstable.d.ts')
-rw-r--r--cli/dts/lib.deno.unstable.d.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index 0bd4c7474..78a7e79c2 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -167,6 +167,29 @@ declare namespace Deno {
swapFree: number;
}
+ /** **Unstable** new API. yet to be vetted.
+ *
+ * Returns the total number of logical cpus in the system along with
+ * the speed measured in MHz. If either the syscall to get the core
+ * count or speed of the cpu is unsuccessful the value of the it
+ * is undefined.
+ *
+ * ```ts
+ * console.log(Deno.systemCpuInfo());
+ * ```
+ *
+ * Requires `allow-env` permission.
+ *
+ */
+ export function systemCpuInfo(): SystemCpuInfo;
+
+ export interface SystemCpuInfo {
+ /** Total number of logical cpus in the system */
+ cores: number | undefined;
+ /** The speed of the cpu measured in MHz */
+ speed: number | undefined;
+ }
+
/** **UNSTABLE**: new API, yet to be vetted.
*
* Open and initialize a plugin.