Files
SpeedScope/sample/programs/javascript/simple.js
Jamie Wong 2207ff54ce Add tests for importers (#56)
This also fixes deep copy import for Instruments when copying from Instruments 7

Related to #14
2018-05-29 23:53:03 -07:00

35 lines
412 B
JavaScript

function a() {
for (let i = 0; i < 1000; i++) {
b()
c()
}
}
function b() {
for (let i = 0; i < 10; i++) {
d()
}
}
function c() {
for (let i = 0; i < 10; i++) {
d()
}
}
function d() {
let prod = 1
for (let i = 1; i < 1000; i++) {
prod *= i
}
return prod
}
console.profile('a')
a()
setTimeout(() => {
console.profileEnd('a')
}, 0)
window.addEventListener('click', a)