aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/performance.test.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-10-18 13:36:44 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-10-18 13:36:44 -0700
commit693b1c9b2329a016901dd5b45146dc1cf4a9dab8 (patch)
tree5e17cf214c33ed07c2333e7ce8bd9d1dbfdd00d2 /test/bun.js/performance.test.js
parentce0efc37cc99cb9476697afc232aafcb57f48051 (diff)
downloadbun-693b1c9b2329a016901dd5b45146dc1cf4a9dab8.tar.gz
bun-693b1c9b2329a016901dd5b45146dc1cf4a9dab8.tar.zst
bun-693b1c9b2329a016901dd5b45146dc1cf4a9dab8.zip
Implement `performance.timeOrigin`
Diffstat (limited to 'test/bun.js/performance.test.js')
-rw-r--r--test/bun.js/performance.test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/bun.js/performance.test.js b/test/bun.js/performance.test.js
index 5e8520638..0ff75b945 100644
--- a/test/bun.js/performance.test.js
+++ b/test/bun.js/performance.test.js
@@ -16,3 +16,9 @@ it("performance.now() should be monotonic", () => {
expect(Bun.nanoseconds() > sixth).toBe(true);
expect(typeof Bun.nanoseconds() === "number").toBe(true);
});
+
+it("performance.timeOrigin + performance.now() should be similar to Date.now()", () => {
+ expect(
+ Math.abs(performance.timeOrigin + performance.now() - Date.now()) < 1000
+ ).toBe(true);
+});