summaryrefslogtreecommitdiffstats
path: root/vbench/src/vbench/core/timer.cpp
blob: 72bd35d27c816fa199472219f3fd61a0e102efb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "timer.h"

namespace vbench {

Timer::Timer()
    : _time()
{
    reset();
}

void
Timer::reset()
{
    _time.SetNow();
}

double
Timer::sample() const
{
    return (_time.MilliSecsToNow() / 1000.0);
}

} // namespace vbench