Browse Source

<HW_Замыкания>

Mark 1 year ago
parent
commit
eac22966e2
1 changed files with 11 additions and 0 deletions
  1. 11 0
      09/main.js

+ 11 - 0
09/main.js

@@ -0,0 +1,11 @@
+// makeProfileTimer
+function makeProfileTimer() {
+   let first = performance.now();
+   return function () {
+      let second = performance.now();
+      return second - first
+   };
+}
+var timer = makeProfileTimer();
+alert("Замеряем время работы этого alert");
+alert(`${timer()} ms`);