From: Jérôme Benoit Date: Sun, 23 Apr 2023 00:13:48 +0000 (+0200) Subject: test: use monotonic timer X-Git-Tag: v1.2.11~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f204e9b4dcd8d329d5cd6bd44f957f4f74449d0d;p=e-mobility-charging-stations-simulator.git test: use monotonic timer Signed-off-by: Jérôme Benoit --- diff --git a/test/utils/UtilsTest.ts b/test/utils/UtilsTest.ts index 9bf70802..5732e57e 100644 --- a/test/utils/UtilsTest.ts +++ b/test/utils/UtilsTest.ts @@ -17,9 +17,9 @@ describe('Utils test suite', () => { }); it('Verify sleep()', async () => { - const start = Date.now(); + const start = performance.now(); await Utils.sleep(1000); - const end = Date.now(); + const end = performance.now(); expect(end - start).toBeGreaterThanOrEqual(1000); });