From fc4981e3ea863632c88e5f0b308ae4532d077e49 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 13 Dec 2020 12:35:33 +0100 Subject: Added execution timers --- 2020/09/solve.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to '2020/09') diff --git a/2020/09/solve.js b/2020/09/solve.js index 394bd4b..f1289c7 100644 --- a/2020/09/solve.js +++ b/2020/09/solve.js @@ -1,3 +1,4 @@ +const { _, performance } = require("perf_hooks"); const fs = require("fs"); const data = fs .readFileSync("input", "utf8") @@ -40,6 +41,9 @@ function partTwo(num) { } } +const tic = performance.now(); const num = partOne(); console.log(num); console.log(partTwo(num)); +const toc = performance.now(); +console.log("TIME: " + ((toc - tic) / 1000).toFixed(6) + " seconds"); -- cgit v1.2.3