| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c3721fc commit 8a42a20
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1265,7 +1265,9 @@ import { | |||
| 1265 | 1265 | ||
| 1266 | 1266 | if (isMainThread) { | |
| 1267 | 1267 | new Worker(new URL(import.meta.url)); | |
| 1268 | - for (let n = 0; n < 1e10; n++) {} | ||
| 1268 | + for (let n = 0; n < 1e10; n++) { | ||
| 1269 | + // Looping to simulate work. | ||
| 1270 | + } | ||
| 1269 | 1271 | } else { | |
| 1270 | 1272 | // This output will be blocked by the for loop in the main thread. | |
| 1271 | 1273 | console.log('foo'); | |
@@ -1282,7 +1284,9 @@ const { | |||
| 1282 | 1284 | ||
| 1283 | 1285 | if (isMainThread) { | |
| 1284 | 1286 | new Worker(__filename); | |
| 1285 | - for (let n = 0; n < 1e10; n++) {} | ||
| 1287 | + for (let n = 0; n < 1e10; n++) { | ||
| 1288 | + // Looping to simulate work. | ||
| 1289 | + } | ||
| 1286 | 1290 | } else { | |
| 1287 | 1291 | // This output will be blocked by the for loop in the main thread. | |
| 1288 | 1292 | console.log('foo'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments