Thrill  0.1
timestamp.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * tlx/timestamp.cpp
3  *
4  * Part of tlx - http://panthema.net/tlx
5  *
6  * Copyright (C) 2019 Timo Bingmann <[email protected]>
7  *
8  * All rights reserved. Published under the Boost Software License, Version 1.0
9  ******************************************************************************/
10 
11 #include <tlx/timestamp.hpp>
12 
13 #include <chrono>
14 
15 namespace tlx {
16 
17 double timestamp() {
18  return static_cast<double>(
19  std::chrono::duration_cast<std::chrono::microseconds>(
20  std::chrono::steady_clock::now().time_since_epoch()).count()) / 1e6;
21 }
22 
23 } // namespace tlx
24 
25 /******************************************************************************/
double timestamp()
Returns number of seconds since the epoch, currently microsecond resolution.
Definition: timestamp.cpp:17