async Task<long> post()
{
var stopwatch = new Stopwatch();
stopwatch.Start();
var client = new HttpClient();
await client.GetStringAsync("https://www.baidu.com");
stopwatch.Stop();
return stopwatch.ElapsedMilliseconds;
}
public async Task<long[]> Exec()
{
Task<long>[] tasks = new Task<long>[10];
for (int i = 0; i < 10; i++)
{
tasks[i] = post();
}
await Task.WhenAll(tasks);
return tasks.Select(x => x.Result).ToArray();
}