From 438b3d48e49c81e49b283565fe61c53a09a7b541 Mon Sep 17 00:00:00 2001 From: Austin Noska Date: Fri, 30 Aug 2019 17:19:17 -0400 Subject: [PATCH] feat: Implemented Processor Utils for Net Standard to get the system uptime and the program uptime. --- ICD.Common.Utils/ProcessorUtils.Standard.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ICD.Common.Utils/ProcessorUtils.Standard.cs b/ICD.Common.Utils/ProcessorUtils.Standard.cs index 5755431..a69cd0d 100644 --- a/ICD.Common.Utils/ProcessorUtils.Standard.cs +++ b/ICD.Common.Utils/ProcessorUtils.Standard.cs @@ -142,8 +142,7 @@ namespace ICD.Common.Utils [PublicAPI] public static TimeSpan GetSystemUptime() { - // TODO - return default(TimeSpan); + return TimeSpan.FromMilliseconds(Environment.TickCount); } /// @@ -153,8 +152,8 @@ namespace ICD.Common.Utils [PublicAPI] public static TimeSpan GetProgramUptime() { - // TODO - return default(TimeSpan); + var current = System.Diagnostics.Process.GetCurrentProcess(); + return IcdEnvironment.GetLocalTime() - current.StartTime; } #endregion