使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 0408576e9da10015ffa9da0079b8c985113ce4b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// CPerfTimer - a simple Win32 performance counter wrapper
// by Dean Wyant dwyant@mindspring.com
 
#include "stdafx.h"
#include "PerfTimer.h"
 
// Declare and initialize static member vars that get set only once and never change
__int64 CPerfTimer::m_Freq = 0; 
__int64 CPerfTimer::m_Adjust = 0; 
 
// All functions defined inline for speed. After all, the performance counter is 
// supposed to be able to time very short events fairly accurately.
 
 
 
BOOL CPerfTimer::IsSupported()
{ // Returns FALSE if performance counter not supported.
  // Call after constructing at least one CPerfTimer
  return (m_Freq > 1);
}
 
const double CPerfTimer::Resolution()   
{ // Returns timer resolution in seconds
  return 1.0/(double)m_Freq; 
}
 
const double CPerfTimer::Resolutionms() 
{    // Returns timer resolution in milliseconds
    return 1000.0/(double)m_Freq; 
}
 
const double CPerfTimer::Resolutionus() 
{ // Returns timer resolution in microseconds
    return 1000000.0/(double)m_Freq; 
}
 
void CPerfTimer::Trace(LPCTSTR lpsz)
{
    double nElapsedus = Elapsedus();
    ATLTRACE( _T("%s: %f\n"), lpsz, nElapsedus );
}
 
void CPerfTimerT::Trace(LPCTSTR lpsz)
{
    double nElapsedus = Elapsedus();
    ATLTRACE( _T("%s: %f\n"), lpsz, nElapsedus );
}