blob: f4cbd39d73773f89b424507676e5cba11eb3da35 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
bungeman@google.combe9ad4e2011-06-07 19:16:02 +00008#include "BenchSysTimer_c.h"
9
10//Time
11#include <time.h>
12
13void BenchSysTimer::startWall() {
14 this->fStartWall = time();
15}
16void BenchSysTimer::startCpu() {
17 this->fStartCpu = clock();
18}
19
20double BenchSysTimer::endCpu() {
21 clock_t end_cpu = clock();
22 this->fCpu = (end_cpu - this->fStartCpu) * CLOCKS_PER_SEC / 1000.0;
23}
24double BenchSysTimer::endWall() {
25 time_t end_wall = time();
26 this->fWall = difftime(end_wall, this->fstartWall) / 1000.0;
27}