diff options
author | 2022-10-18 13:36:44 -0700 | |
---|---|---|
committer | 2022-10-18 13:36:44 -0700 | |
commit | 693b1c9b2329a016901dd5b45146dc1cf4a9dab8 (patch) | |
tree | 5e17cf214c33ed07c2333e7ce8bd9d1dbfdd00d2 /test/bun.js/performance.test.js | |
parent | ce0efc37cc99cb9476697afc232aafcb57f48051 (diff) | |
download | bun-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.js | 6 |
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); +}); |