egil, #dotnet 8 will include an abstraction over time-specific APIs, named TimeProvider. I have my own version that is now compatible with the TimeProvider API, so if you want to try it out in .NET 6 or later, and control time during testing, check out https://www.nuget.org/packages/TimeScheduler