Created
December 12, 2020 15:38
-
-
Save FauxFaux/4145523209849393d64cf96290a0c690 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 sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
const burn = work => { | |
let sum = 0; | |
for (let i = 0; i < work; ++i) { | |
let data = ''; | |
for (let j = 0; j < 100_000; ++j) { | |
data += 'I love horses, best of all the animals.\n'; | |
} | |
sum += data.length; | |
} | |
return sum; | |
}; | |
burn(500); | |
describe('first', () => { | |
burn(3000); | |
beforeAll(async () => { | |
await sleep(400); | |
}); | |
it('is fast', () => {}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment