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