Dotnet, Development, C Sharp Programming, Csharp, Microsoft.
below, which has a Task.Delay, and receives TimeSpan and a TimeProvider as parameters: public async Task MethodWithDelay() { Console.WriteLine($"Start of Task.Delay: {_timeProvider.GetUtcNow()}"); await Task.Delay(TimeSpan.FromSeconds(3), _timeProvider); Console.WriteLine($"End of Task.Delay: