Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In the .NET world, the TimeProvider class, is in the .NET framework from version 8 onwards. (1)

And a "wall clock" or "test clock" injected using DI as needed. (equivalent to option 1 + 4)

Write your own "test clock" or use the supplied fake: (2)

In earlier versions, we rolled our own "clock" interface.

1) https://learn.microsoft.com/en-us/dotnet/api/system.timeprov...

2) https://learn.microsoft.com/en-us/dotnet/api/microsoft.exten...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: