Clone of UAS2 @ https://github.com/drudgedance/uas2

Timer.h 805B

12345678910111213141516171819202122232425262728293031
  1. // Timer.h: interface for the Timer class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_TIMELIMIT_H__D2107E6A_33E5_11D3_8D14_00E0980636C2__INCLUDED_)
  5. #define AFX_TIMELIMIT_H__D2107E6A_33E5_11D3_8D14_00E0980636C2__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. class Timer
  10. {
  11. public:
  12. void StopTicking();
  13. void StartTicking();
  14. Timer();
  15. virtual ~Timer();
  16. int GetTimeout(){return m_msTimeout;}
  17. void SetTimeout(int t){m_msTimeout=t;}
  18. protected:
  19. int m_msTimeout;
  20. virtual void Tick();
  21. private:
  22. HANDLE m_hThreadDone;
  23. bool m_bStop;
  24. static UINT TickerThread(LPVOID pParam);
  25. HANDLE m_hEndThread;
  26. };
  27. #endif // !defined(AFX_TIMELIMIT_H__D2107E6A_33E5_11D3_8D14_00E0980636C2__INCLUDED_)