/// <summary> /// 开始时间片的处理 /// </summary> public void Start() { if (!m_Running) { TimerThread.AddTimer(this); m_Running = true; TimerProfile timerProfile = TimerProfile.GetProfile(TimeSliceName); timerProfile.RegStart(); } }
/// <summary> /// 停止时间片的处理 /// </summary> public void Stop() { if (m_Running) { TimerThread.RemoveTimer(this); m_Running = false; TimerProfile timerProfile = TimerProfile.GetProfile(TimeSliceName); timerProfile.RegStopped(); // 时间片已经停止的回调事件 OnStopTimeSlice(); } }