File: WallTimeSource.cpp

package info (click to toggle)
pentobi 29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,892 kB
  • sloc: cpp: 25,719; javascript: 875; xml: 40; makefile: 13; sh: 6
file content (25 lines) | stat: -rw-r--r-- 756 bytes parent folder | download | duplicates (3)
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
//-----------------------------------------------------------------------------
/** @file libboardgame_base/WallTimeSource.cpp
    @author Markus Enzenberger
    @copyright GNU General Public License version 3 or later */
//-----------------------------------------------------------------------------

#include "WallTimeSource.h"

#include <chrono>

namespace libboardgame_base {

using namespace std::chrono;

//-----------------------------------------------------------------------------

double WallTimeSource::operator()()
{
    auto t = system_clock::now().time_since_epoch();
    return duration_cast<duration<double>>(t).count();
}

//-----------------------------------------------------------------------------

} // namespace libboardgame_base