public void Run() { Int64 now = UtilsCore.UnixTimeStampMs(); m_timeLastStart = now; OnRun(); m_timeLastEnd = now; if (m_thread != null) { m_thread = null; } }
public void CheckRun() { if (m_cancelRequested) { return; } Int64 now = UtilsCore.UnixTimeStampMs(); if (m_thread != null) { // Already running } else if ((m_timeLastStart != 0) && (m_timeLastEnd < m_timeLastStart)) { // Already running } else if (now - m_timeLastEnd < m_timeEvery) { // Not need } else { //Engine.Instance.Logs.LogVerbose("Run job " + this.GetType().FullName); if (GetSync()) { Run(); } else { m_thread = new System.Threading.Thread(this.Run); m_thread.Priority = GetPriority(); m_thread.Start(); } } }
public void LogDebug(string message) { long ts = UtilsCore.UnixTimeStampMs(); LogVerbose(ts.ToString() + ":" + message); }