Last active
December 16, 2019 16:31
-
-
Save shisama/3152c82a7444f1eb8902b05ee025acd4 to your computer and use it in GitHub Desktop.
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 characters
const start = performance.now(); | |
interface Member { | |
name: string; | |
birthday: Date; | |
url: string; | |
instrument: string; | |
} | |
const john: Member = { | |
name: 'John Lennon', | |
birthday: new Date('1940-10-09'), | |
url: 'www.johnlennon.com', | |
instrument: '', | |
}; | |
const paul: Member = { | |
name: 'Paul McCartney', | |
birthday: new Date('1942-06-18'), | |
url: 'https://www.paulmccartney.com/', | |
instrument: 'bass', | |
}; | |
const george: Member = { | |
name: 'George Harrison', | |
birthday: new Date('1943-02-25'), | |
url: 'http://www.georgeharrison.com/', | |
instrument: 'guitar', | |
}; | |
const ringo: Member = { | |
name: 'Ringo Starr', | |
birthday: new Date('1940-07-07'), | |
url: 'http://www.ringostarr.com/', | |
instrument: 'Drums', | |
}; | |
const beatles = [john, paul, george, ringo]; | |
for (var i = 0; i < 1000 * 1000 * 1000; i++) { | |
beatles[i & 3].name; | |
} | |
const end = performance.now(); | |
console.log(end - start); | |
// V8 7.9.317.31 | |
// 1275.9350000414997 | |
// 1279.7900000587106 | |
// 1277.959999977611 | |
// Firefox 69 | |
// 47372 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment