From a92f3fc5d08f78d264b5343a1f234f875781da9e Mon Sep 17 00:00:00 2001 From: Lucas Trzesniewski Date: Wed, 26 Jun 2019 10:50:45 +0200 Subject: [PATCH] Avoid an exception on non-Windows OS --- src/ZeroLog/Utils/HighResolutionDateTime.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ZeroLog/Utils/HighResolutionDateTime.cs b/src/ZeroLog/Utils/HighResolutionDateTime.cs index b6fa19e5..5cc53905 100644 --- a/src/ZeroLog/Utils/HighResolutionDateTime.cs +++ b/src/ZeroLog/Utils/HighResolutionDateTime.cs @@ -26,6 +26,9 @@ public static DateTime UtcNow [DebuggerStepThrough] private static bool CheckAvailability() { + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + return false; + try { GetSystemTimePreciseAsFileTime(out _);