From ea81496b13928c14058744898fa2c7c7f43ec9ab Mon Sep 17 00:00:00 2001 From: Behnam Mohammadi Date: Sat, 8 May 2021 16:20:45 +0430 Subject: [PATCH] fix: for more accuracy Date.now replaced with process.uptime --- test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test.js b/test.js index 1028af7..40e5806 100644 --- a/test.js +++ b/test.js @@ -8,9 +8,9 @@ function test(max) { return sum; } -var start = new Date().getTime(); +var start = process.uptime(); test(100000000); -var end = new Date().getTime(); +var end = process.uptime(); var time = end - start; -process.stdout.write("JavaScript: " + time + "ms\n"); \ No newline at end of file +process.stdout.write("JavaScript: " + (time * 1000) + "ms\n"); \ No newline at end of file