| 100 | } |
| 101 | |
| 102 | CpuStatTimer::CpuStatTimer( ): nEvents( 0 ), nSamples( 0 ), normalize( true ) |
| 103 | { |
| 104 | #if defined( _WIN32 ) |
| 105 | // OS call to get ticks per second2 |
| 106 | ::QueryPerformanceFrequency( reinterpret_cast<LARGE_INTEGER*>( &clkFrequency ) ); |
| 107 | #else |
| 108 | res.tv_sec = 0; |
| 109 | res.tv_nsec = 0; |
| 110 | clkFrequency = 0; |
| 111 | |
| 112 | // clock_getres() return 0 for success |
| 113 | // If the function fails (monotonic clock not supported), we default to a lower resolution timer |
| 114 | // if( ::clock_getres( CLOCK_MONOTONIC, &res ) ) |
| 115 | { |
| 116 | clkFrequency = 1000000; |
| 117 | } |
| 118 | // else |
| 119 | // { |
| 120 | // // Turn time into frequency |
| 121 | // clkFrequency = res.tv_nsec * 1000000000; |
| 122 | // } |
| 123 | |
| 124 | #endif |
| 125 | } |
| 126 | |
| 127 | CpuStatTimer::~CpuStatTimer( ) |
| 128 | {} |
nothing calls this directly
no outgoing calls
no test coverage detected