summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/dts/lib.deno.shared_globals.d.ts1
-rw-r--r--cli/tests/unit/performance_test.ts7
2 files changed, 8 insertions, 0 deletions
diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts
index 5f44e2d1b..b96c56dba 100644
--- a/cli/dts/lib.deno.shared_globals.d.ts
+++ b/cli/dts/lib.deno.shared_globals.d.ts
@@ -450,6 +450,7 @@ declare class Worker extends EventTarget {
declare type PerformanceEntryList = PerformanceEntry[];
declare class Performance {
+ readonly timeOrigin: number;
constructor();
/** Removes the stored timestamp with the associated name. */
diff --git a/cli/tests/unit/performance_test.ts b/cli/tests/unit/performance_test.ts
index 4c7d08d4e..252a31fc4 100644
--- a/cli/tests/unit/performance_test.ts
+++ b/cli/tests/unit/performance_test.ts
@@ -20,6 +20,13 @@ Deno.test({ permissions: { hrtime: false } }, async function performanceNow() {
assert(totalTime >= 10);
});
+Deno.test(function timeOrigin() {
+ const origin = performance.timeOrigin;
+
+ assert(origin > 0);
+ assert(Date.now() >= origin);
+});
+
Deno.test(function performanceMark() {
const mark = performance.mark("test");
assert(mark instanceof PerformanceMark);