KTimer.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:1k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //---------------------------------------------------------------------------
  2. // Sword3 Engine (c) 1999-2000 by Kingsoft
  3. //
  4. // File: KTimer.h
  5. // Date: 2000.08.08
  6. // Code: WangWei(Daphnis)
  7. // Desc: Header File
  8. //---------------------------------------------------------------------------
  9. #ifndef KTimer_H
  10. #define KTimer_H
  11. //---------------------------------------------------------------------------
  12. #ifdef WIN32
  13. class ENGINE_API KTimer
  14. #else
  15. class KTimer
  16. #endif
  17. {
  18. private:
  19. #ifdef WIN32
  20. LARGE_INTEGER m_nFrequency;
  21. LARGE_INTEGER m_nTimeStart;
  22. LARGE_INTEGER m_nTimeStop;
  23. #else
  24. timeval m_nTimeStart;
  25. timeval m_nTimeStop;
  26. #endif
  27. int m_nFPS;
  28. public:
  29. KTimer();
  30. void Start();
  31. void Stop();
  32. DWORD GetElapse();
  33. DWORD GetElapseFrequency();
  34. DWORD GetInterval();
  35. BOOL Passed(int nTime);
  36. BOOL GetFPS(int* nFPS);
  37. };
  38. #endif