Skip to content

Instantly share code, notes, and snippets.

@EtherDream
Created May 5, 2022 03:27
Show Gist options
  • Save EtherDream/45808bf70719e8acf8161bd1453ee0a6 to your computer and use it in GitHub Desktop.
Save EtherDream/45808bf70719e8acf8161bd1453ee0a6 to your computer and use it in GitHub Desktop.
(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