bungeman@google.com | be9ad4e | 2011-06-07 19:16:02 +0000 | [diff] [blame] | 1 | #include "BenchSysTimer_c.h" |
| 2 | |
| 3 | //Time |
| 4 | #include <time.h> |
| 5 | |
| 6 | void BenchSysTimer::startWall() { |
| 7 | this->fStartWall = time(); |
| 8 | } |
| 9 | void BenchSysTimer::startCpu() { |
| 10 | this->fStartCpu = clock(); |
| 11 | } |
| 12 | |
| 13 | double BenchSysTimer::endCpu() { |
| 14 | clock_t end_cpu = clock(); |
| 15 | this->fCpu = (end_cpu - this->fStartCpu) * CLOCKS_PER_SEC / 1000.0; |
| 16 | } |
| 17 | double BenchSysTimer::endWall() { |
| 18 | time_t end_wall = time(); |
| 19 | this->fWall = difftime(end_wall, this->fstartWall) / 1000.0; |
| 20 | } |