Skip to content

Commit

Permalink
Merge pull request #31 from masm22/master
Browse files Browse the repository at this point in the history
Fix running on Linux. Closes #30.
  • Loading branch information
MendelMonteiro authored Mar 13, 2019
2 parents 9a8029d + 6435db2 commit 3741bce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ZeroLog/Utils/HighResolutionDateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static DateTime UtcNow
if (!_isAvailable)
return DateTime.UtcNow;

GetSystemTimePreciseAsFileTime(out var filetime);
GetSystemTimePreciseAsFileTime(out var filetime);
return DateTime.FromFileTimeUtc(filetime);
}
}
Expand All @@ -28,9 +28,14 @@ private static bool CheckAvailability()
{
try
{
GetSystemTimePreciseAsFileTime(out _);
GetSystemTimePreciseAsFileTime(out _);
return true;
}
catch (DllNotFoundException)
{
// Not running Windows 8 or higher.
return false;
}
catch (EntryPointNotFoundException)
{
// Not running Windows 8 or higher.
Expand Down

0 comments on commit 3741bce

Please sign in to comment.