blob: 2547a1a01030287c7daf51f4432a4e350ed7cacd (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
// Use some CPU.
var interval = window.setInterval(() => {
// Compute an arbitrary value, print it out to make sure that the JS
// engine doesn't discard all our computation.
var date = Date.now();
var array = [];
var i = 0;
while (Date.now() - date <= 100) {
array[i % 2] = i++;
}
}, 300);
|