| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 125ed0c commit 330c1bc
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1255,7 +1255,9 @@ import { | |||
| 1255 | 1255 | ||
| 1256 | 1256 | if (isMainThread) { | |
| 1257 | 1257 | new Worker(new URL(import.meta.url)); | |
| 1258 | - for (let n = 0; n < 1e10; n++) {} | ||
| 1258 | + for (let n = 0; n < 1e10; n++) { | ||
| 1259 | + // Looping to simulate work. | ||
| 1260 | + } | ||
| 1259 | 1261 | } else { | |
| 1260 | 1262 | // This output will be blocked by the for loop in the main thread. | |
| 1261 | 1263 | console.log('foo'); | |
@@ -1272,7 +1274,9 @@ const { | |||
| 1272 | 1274 | ||
| 1273 | 1275 | if (isMainThread) { | |
| 1274 | 1276 | new Worker(__filename); | |
| 1275 | - for (let n = 0; n < 1e10; n++) {} | ||
| 1277 | + for (let n = 0; n < 1e10; n++) { | ||
| 1278 | + // Looping to simulate work. | ||
| 1279 | + } | ||
| 1276 | 1280 | } else { | |
| 1277 | 1281 | // This output will be blocked by the for loop in the main thread. | |
| 1278 | 1282 | console.log('foo'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments