Esempio n. 1
0
        /// <summary>
        /// 开始时间片的处理
        /// </summary>
        public void Start()
        {
            if (!m_Running)
            {
                TimerThread.AddTimer(this);

                m_Running = true;

                TimerProfile timerProfile = TimerProfile.GetProfile(TimeSliceName);
                timerProfile.RegStart();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 停止时间片的处理
        /// </summary>
        public void Stop()
        {
            if (m_Running)
            {
                TimerThread.RemoveTimer(this);
                m_Running = false;

                TimerProfile timerProfile = TimerProfile.GetProfile(TimeSliceName);
                timerProfile.RegStopped();

                // 时间片已经停止的回调事件
                OnStopTimeSlice();
            }
        }