Add web worker stress application

Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
Severin Kaderli 2022-10-10 19:23:35 +02:00
parent 5e06c738e5
commit 93dfeb443b
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
3 changed files with 40 additions and 1 deletions

View file

@ -58,4 +58,12 @@
* https://www.youtube.com/watch?v=L_ZBn6RVJ88
# 2022-10-06
*
* Mail Exchange with Reto about Experiments
* Work on persona
# 2022-10-07
* More experiments and data analysis
* Decide on CPU as sender element
# 2022-10-10
* Create small application to create stress on CPU using web workers

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
Hello World!
<script>
let workers = [];
function startWorkers() {
for (let i = 0; i < 8; i++) {
workers.push(new Worker("worker.js"));
}
setTimeout(stopWorkers, 2000);
}
function stopWorkers() {
for (const worker of workers) {
worker.terminate();
}
setTimeout(startWorkers, 2000);
}
startWorkers();
</script>
</body>
</html>

View file

@ -0,0 +1 @@
while(true){}