From 3f7eb773a2c8775fa263b696b6a611e484e437a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 10 Oct 2022 21:57:38 +0200 Subject: [PATCH] new Date().getTime() -> Date.now() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/pools/cluster/fixed.test.js | 4 ++-- tests/pools/thread/fixed.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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) }) -- 2.34.1