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.

47 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: 09/07/2001
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: PerformanceCounter.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of PerformanceCounter.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "PerformanceCounter.h"
  16. #include <stdio.h>
  17. CPerformanceCounter::CPerformanceCounter()
  18. {
  19. ::QueryPerformanceFrequency( &m_liFrequency );
  20. }
  21. CPerformanceCounter::~CPerformanceCounter()
  22. {
  23. }
  24. void CPerformanceCounter::Begin()
  25. {
  26. ::QueryPerformanceCounter( &m_liCounter );
  27. }
  28. double CPerformanceCounter::End()
  29. {
  30. LARGE_INTEGER li;
  31. ::QueryPerformanceCounter( &li );
  32. double r = (double)(li.QuadPart - m_liCounter.QuadPart) / (double) m_liFrequency.QuadPart;
  33. #ifdef _DEBUG
  34. char pText[10];
  35. sprintf( pText, "%0.9f\n", r );
  36. OutputDebugString( pText );
  37. #endif
  38. return r;
  39. }