MCPcopy Create free account
hub / github.com/clMathLibraries/clSPARSE / clsparseHostTimer

Method clsparseHostTimer

src/clsparseTimer/clsparseTimer-host.cpp:103–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103clsparseHostTimer::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
128clsparseHostTimer::~clsparseHostTimer( )
129{}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected