test: use monotonic timer
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 23 Apr 2023 00:13:48 +0000 (02:13 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 23 Apr 2023 00:13:48 +0000 (02:13 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
test/utils/UtilsTest.ts

index 9bf708027caf654f390b7bad646c4c94589cdb72..5732e57ed316673e1cbc538d9b853a0c33d90665 100644 (file)
@@ -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);
   });