MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / CpuStatTimer

Method CpuStatTimer

src/statTimer/statisticalTimer.CPU.cpp:102–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102CpuStatTimer::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
127CpuStatTimer::~CpuStatTimer( )
128{}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected