Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT: Laserguard libraries
  7. // SUBSYSTEM: LgLib
  8. // FILE: LgPerformanceCounter.h
  9. // AUTHOR: Chizhevskiy Sergey
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of CLgPerformanceCounter
  13. //----------------------------------------------------------------------------
  14. #ifndef __LG__PERFORMANCE__COUNTER__H__INCLUDED__
  15. #define __LG__PERFORMANCE__COUNTER__H__INCLUDED__
  16. class CLgPerformanceCounter
  17. {
  18. public:
  19. CLgPerformanceCounter();
  20. ~CLgPerformanceCounter();
  21. public:
  22. void Begin() { ::QueryPerformanceCounter( &m_PerformanceCounter[0] ); }
  23. double End()
  24. {
  25. ::QueryPerformanceCounter( &m_PerformanceCounter[1] );
  26. return ((double)m_PerformanceCounter[1].QuadPart -
  27. (double)m_PerformanceCounter[0].QuadPart) /
  28. (double)m_PerformanceFriquency.QuadPart;
  29. }
  30. private:
  31. LARGE_INTEGER m_PerformanceFriquency;
  32. LARGE_INTEGER m_PerformanceCounter[2];
  33. };
  34. #endif