From: Jérôme Benoit Date: Mon, 10 Oct 2022 19:57:38 +0000 (+0200) Subject: new Date().getTime() -> Date.now() X-Git-Tag: v2.3.1~32 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3f7eb773a2c8775fa263b696b6a611e484e437a8;p=poolifier.git new Date().getTime() -> Date.now() Signed-off-by: Jérôme Benoit --- diff --git a/tests/pools/cluster/fixed.test.js b/tests/pools/cluster/fixed.test.js index b1005595..e9583741 100644 --- a/tests/pools/cluster/fixed.test.js +++ b/tests/pools/cluster/fixed.test.js @@ -124,9 +124,9 @@ describe('Fixed cluster pool test suite', () => { it('Verify that async function is working properly', async () => { const data = { f: 10 } - const startTime = new Date().getTime() + const startTime = Date.now() const result = await asyncPool.execute(data) - const usedTime = new Date().getTime() - startTime + const usedTime = Date.now() - startTime expect(result).toStrictEqual(data) expect(usedTime).toBeGreaterThanOrEqual(2000) }) diff --git a/tests/pools/thread/fixed.test.js b/tests/pools/thread/fixed.test.js index 5bbc8e0e..c7abad00 100644 --- a/tests/pools/thread/fixed.test.js +++ b/tests/pools/thread/fixed.test.js @@ -128,9 +128,9 @@ describe('Fixed thread pool test suite', () => { it('Verify that async function is working properly', async () => { const data = { f: 10 } - const startTime = new Date().getTime() + const startTime = Date.now() const result = await asyncPool.execute(data) - const usedTime = new Date().getTime() - startTime + const usedTime = Date.now() - startTime expect(result).toStrictEqual(data) expect(usedTime).toBeGreaterThanOrEqual(2000) })