| 203 | } |
| 204 | |
| 205 | void |
| 206 | CpuStatTimer::Stop( size_t id ) |
| 207 | { |
| 208 | cl_ulong n; |
| 209 | |
| 210 | #if defined( _WIN32 ) |
| 211 | ::QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &n ) ); |
| 212 | #else |
| 213 | struct timeval s; |
| 214 | gettimeofday( &s, 0 ); |
| 215 | n = (cl_ulong)s.tv_sec * 1000000 + (cl_ulong)s.tv_usec; |
| 216 | #endif |
| 217 | |
| 218 | n -= clkStart.at( id ); |
| 219 | clkStart.at( id ) = 0; |
| 220 | AddSample( id, n ); |
| 221 | } |
| 222 | |
| 223 | void |
| 224 | CpuStatTimer::AddSample( const size_t id, const cl_ulong n ) |