0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fast_clock.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3
9  * of the License.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
26 
27 #ifndef Common_fast_clock_h
28 #define Common_fast_clock_h
29 
30 #include <chrono>
31 #include <ctime>
32 
33 namespace std {
34 
35  namespace chrono {
36 
37  class fast_clock {
38  public:
39  typedef microseconds duration;
40  typedef duration::rep rep;
41  typedef duration::period period;
42  typedef chrono::time_point<fast_clock> time_point;
43  static constexpr bool is_steady = false;
44 
45  static time_point now() noexcept;
46  static time_t to_time_t (const time_point& __t) noexcept;
47  static time_point from_time_t(time_t __t) noexcept;
48  };
49 
50  }
51 }
52 
53 #endif // Common_fast_clock_h
duration::period period
Definition: fast_clock.h:41
static time_point from_time_t(time_t __t) noexcept
Definition: fast_clock.cc:47
chrono::time_point< fast_clock > time_point
Definition: fast_clock.h:42
STL namespace.
static time_point now() noexcept
Definition: fast_clock.cc:37
duration::rep rep
Definition: fast_clock.h:40
microseconds duration
Definition: fast_clock.h:39
static time_t to_time_t(const time_point &__t) noexcept
Definition: fast_clock.cc:43
static constexpr bool is_steady
Definition: fast_clock.h:43