Hello,
Welcome to our Microsoft Q&A platform!
You could create a set of tasks that format times in an array. The tasks are stored in a List collection that is passed to the WhenAll(IEnumerable) method. When you call the Wait method, all the thread run synchronously, it will speed up operations. For example:
Debug.WriteLine(DateTime.Now.ToString("hh:mm:ss.ff"));
var tasks = new List();
for (int i = 0; i < 1440; i++) {
tasks.Add(Task.Run(() =>
{
DateTimeOffset dateAndTime = new DateTimeOffset(1970+i, 5, 1, 8, 6, 32,
new TimeSpan(1, 0, 0));
DateTimeFormatter.ShortTime.Format(dateAndTime);
}));
}
Task t = Task.WhenAll(tasks);
t.Wait();
Debug.WriteLine(DateTime.Now.ToString("hh:mm:ss.ff"));
Output:
10:06:02.40
10:06:02.66