mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-14 04:58:33 +00:00
Simplifying timer
This commit is contained in:
parent
222365f210
commit
b3313493cc
1 changed files with 4 additions and 7 deletions
|
|
@ -18,7 +18,7 @@ namespace ICD.Common.Utils.Timers
|
||||||
private readonly CTimer m_Timer;
|
private readonly CTimer m_Timer;
|
||||||
#else
|
#else
|
||||||
private readonly Timer m_Timer;
|
private readonly Timer m_Timer;
|
||||||
private int m_DueTime, m_RepeatPeriod;
|
private int m_RepeatPeriod;
|
||||||
#endif
|
#endif
|
||||||
private readonly Action m_Callback;
|
private readonly Action m_Callback;
|
||||||
|
|
||||||
|
|
@ -55,9 +55,8 @@ namespace ICD.Common.Utils.Timers
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
m_Timer = new CTimer(SafeCallback, null, dueTime, repeatPeriod);
|
m_Timer = new CTimer(SafeCallback, null, dueTime, repeatPeriod);
|
||||||
#else
|
#else
|
||||||
m_DueTime = (int)dueTime;
|
|
||||||
m_RepeatPeriod = (int)repeatPeriod;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -122,8 +121,7 @@ namespace ICD.Common.Utils.Timers
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
m_Timer.Reset(dueTime);
|
m_Timer.Reset(dueTime);
|
||||||
#else
|
#else
|
||||||
m_DueTime = (int)dueTime;
|
m_Timer.Change((int)dueTime, m_RepeatPeriod);
|
||||||
m_Timer.Change(m_DueTime, m_RepeatPeriod);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,9 +135,8 @@ namespace ICD.Common.Utils.Timers
|
||||||
#if SIMPLSHARP
|
#if SIMPLSHARP
|
||||||
m_Timer.Reset(dueTime, repeatPeriod);
|
m_Timer.Reset(dueTime, repeatPeriod);
|
||||||
#else
|
#else
|
||||||
m_DueTime = (int)dueTime;
|
|
||||||
m_RepeatPeriod = (int)repeatPeriod;
|
m_RepeatPeriod = (int)repeatPeriod;
|
||||||
m_Timer.Change(m_DueTime, m_RepeatPeriod);
|
m_Timer.Change((int)dueTime, m_RepeatPeriod);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue