Created
May 5, 2022 03:27
-
-
Save EtherDream/45808bf70719e8acf8161bd1453ee0a6 to your computer and use it in GitHub Desktop.
This file contains 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 characters
(function() { | |
'use strict' | |
let s | |
console.time('t0') | |
for (let i = 0; i < 1e7; i++) { | |
} | |
console.timeEnd('t0') | |
console.time('t1') | |
for (let i = 0; i < 1e7; i++) { | |
s = location.origin | |
} | |
console.timeEnd('t1') | |
const MY_ORIGIN = location.origin | |
console.time('t2') | |
for (let i = 0; i < 1e7; i++) { | |
s = MY_ORIGIN | |
} | |
console.timeEnd('t2') | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment