Код: Выделить всё
using System.Diagnostics;
const int TASKS = 100;
var mainSw = Stopwatch.StartNew();
var tasks = Enumerable.Range(0, TASKS).Select(i =>
Task.Run(async () =>
{
await Task.Delay(5000);
var sum = 0;
for (int j = 1; j
Подробнее здесь: [url]https://stackoverflow.com/questions/79849328/why-when-i-place-i-o-task-before-cpu-bound-task-runs-faster-than-place-i-o-task[/url]
Мобильная версия