From b3313493cc2e6fe5976a2e2a00ea6be4b4c34485 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Wed, 3 Jan 2018 16:59:42 -0500 Subject: [PATCH] Simplifying timer --- ICD.Common.Utils/Timers/SafeTimer.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ICD.Common.Utils/Timers/SafeTimer.cs b/ICD.Common.Utils/Timers/SafeTimer.cs index c79b123..6953a35 100644 --- a/ICD.Common.Utils/Timers/SafeTimer.cs +++ b/ICD.Common.Utils/Timers/SafeTimer.cs @@ -18,7 +18,7 @@ namespace ICD.Common.Utils.Timers private readonly CTimer m_Timer; #else private readonly Timer m_Timer; - private int m_DueTime, m_RepeatPeriod; + private int m_RepeatPeriod; #endif private readonly Action m_Callback; @@ -55,9 +55,8 @@ namespace ICD.Common.Utils.Timers #if SIMPLSHARP m_Timer = new CTimer(SafeCallback, null, dueTime, repeatPeriod); #else - m_DueTime = (int)dueTime; m_RepeatPeriod = (int)repeatPeriod; - m_Timer = new Timer(SafeCallback, null, m_DueTime, m_RepeatPeriod); + m_Timer = new Timer(SafeCallback, null, (int)dueTime, m_RepeatPeriod); #endif } @@ -122,8 +121,7 @@ namespace ICD.Common.Utils.Timers #if SIMPLSHARP m_Timer.Reset(dueTime); #else - m_DueTime = (int)dueTime; - m_Timer.Change(m_DueTime, m_RepeatPeriod); + m_Timer.Change((int)dueTime, m_RepeatPeriod); #endif } @@ -137,9 +135,8 @@ namespace ICD.Common.Utils.Timers #if SIMPLSHARP m_Timer.Reset(dueTime, repeatPeriod); #else - m_DueTime = (int)dueTime; m_RepeatPeriod = (int)repeatPeriod; - m_Timer.Change(m_DueTime, m_RepeatPeriod); + m_Timer.Change((int)dueTime, m_RepeatPeriod); #endif }