Created
May 10, 2018 09:23
-
-
Save mmirolim/bbf109c44e4f388a00b3995fe7834cd6 to your computer and use it in GitHub Desktop.
Revisions
-
mmirolim created this gist
May 10, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ const { performance } = require('perf_hooks'); const fibo = fib() function fib() { let x = 0 let y = 1 return function () { const temp = x; x = x + y; y = temp; return y } } var text = 'For more information, see Chapter 3.4.5.1' var t0 = performance.now(); for (let j=0; j<100; j++) { for (let i=0; i<100; i++){ str = new Date() d = new Date(str) found = text.match(/see (chapter \d+(\.\d)*)/i); console.log(fibo(), str.toString(), found, d) } } var t1 = performance.now(); console.log("Call to doSomething took " + (t1 - t0) + " milliseconds."); // standart x1 770 ms // laptop asus 620 ms // c5.large 570 ms // m5.large 620 ms