blob: 92abac7a384d5151252a5749533da5e914380e03 (
plain)
1
2
3
4
5
6
7
8
|
addEventListener('fetch', evt => {
if (evt.request.url.endsWith('slow')) {
// Performance.now() might be a bit better here, but Date.now() has
// better compat in workers right now.
let start = Date.now();
while(Date.now() - start < 2000);
}
});
|