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