Files
SpeedScope/sample/programs/javascript/simple.js
Jamie Wong f9032f4100 Reorganize sample directory (#34)
This should help keep things organized as speedscope supports more languages & more formats

Test Plan: Try importing from every single file type, see that the link to load the example profile still works
2018-05-08 23:13:38 -07:00

33 lines
375 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)