Created
June 29, 2017 13:30
-
-
Save alastairtree/10433c97da0f33d2229439dbcf2eef8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Util | |
{ | |
public interface IClock | |
{ | |
DateTime NowUtc { get; } | |
} | |
public class Clock : IClock | |
{ | |
public static readonly Clock Default; | |
static Clock() | |
{ | |
Default = new Clock(); | |
} | |
public virtual DateTime NowUtc => DateTime.UtcNow; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment