ARTICLE AD BOX
I run start 100 tasks at the same time. and place Task.Delay(5000) before the for loop. Task.Delay(5000) acts like an i/o task, and the for loop acts like cpu-bound task. When it starts to hits the for loop, it will execute in batch ~ cpu core (8 - 16). so the overal time will be 5s + the longest task of last batch.
if i place Task.Delay(5000) after the for loop, i assume time takes to finish will be roughly the as i place it before the for loop. Because it still starts for loop in batch first, so the overal time taken will be the longest task of last batch + 5s (the delay of last longest task).
But when i test, it seems like if i place Task.Delay(5000) before the for loop, it will run faster than place it after the for loop ~ 200ms.
Can someone helps me to understand deeply how it executes under the hood.
