Esempio n. 1
0
        public void Run()
        {
            m_timeLastStart = Utils.UnixTimeStampMs();

            try
            {
                OnRun();
            }
            catch (Exception e)
            {
                Engine.Instance.Logs.Log(e);
            }

            m_timeLastEnd = Utils.UnixTimeStampMs();
            m_timeLastRun = m_timeLastEnd - m_timeLastStart;

            if (m_thread != null)
            {
                m_thread = null;
            }

            if (this is Jobs.RealtimeNetworkStats)
            {
                Console.WriteLine("x");
            }
        }
Esempio n. 2
0
        public void Run()
        {
            m_timeLastStart = Utils.UnixTimeStampMs();

            try
            {
                OnRun();
            }
            catch (Exception e)
            {
                Engine.Instance.Logs.Log(e);
            }

            m_timeLastEnd = Utils.UnixTimeStampMs();
            m_timeLastRun = m_timeLastEnd - m_timeLastStart;

            if (m_thread != null)
            {
                m_thread = null;
            }
        }
Esempio n. 3
0
        public void CheckRun()
        {
            if (m_cancelRequested)
            {
                return;
            }

            Int64 now = Utils.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();
                }
            }
        }
Esempio n. 4
0
        public void LogDebug(string message)
        {
            long ts = Utils.UnixTimeStampMs();

            LogVerbose(ts.ToString() + ":" + message);
        }