Skip to content

Commit

Permalink
Avoid an exception on non-Windows OS
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Jun 26, 2019
1 parent ed03d11 commit a92f3fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ZeroLog/Utils/HighResolutionDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public static DateTime UtcNow
[DebuggerStepThrough]
private static bool CheckAvailability()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
return false;

try
{
GetSystemTimePreciseAsFileTime(out _);
Expand Down

0 comments on commit a92f3fc

Please sign in to comment.