MRPT  1.9.9
Clock.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <chrono>
12 #include <string>
13 
14 namespace mrpt
15 {
16 /** Clock that is compatible with MRPT TTimeStamp representation
17  * \ingroup mrpt_core_grp
18  */
19 class Clock
20 {
21  public:
22  using rep = int64_t;
23  // 100-nanoseconds
24  using period = std::ratio<1, 10000000>;
25  using duration = std::chrono::duration<rep, period>;
26  using time_point = std::chrono::time_point<Clock>;
27 
28  static constexpr bool is_steady = std::chrono::system_clock::is_steady;
29 
30  /** Returns the current time, with the highest resolution available.
31  * Typically this is better than 1 microsecond. */
32  static time_point now() noexcept;
33  /** Create a timestamp from its double representation. \sa
34  * mrpt::system::timestampToDouble() */
35  static time_point fromDouble(const double t) noexcept;
36 };
37 } // namespace mrpt
int64_t rep
Definition: Clock.h:22
Clock that is compatible with MRPT TTimeStamp representation.
Definition: Clock.h:19
std::chrono::duration< rep, period > duration
Definition: Clock.h:25
GLdouble GLdouble t
Definition: glext.h:3689
static time_point fromDouble(const double t) noexcept
Create a timestamp from its double representation.
Definition: Clock.cpp:51
std::chrono::time_point< Clock > time_point
Definition: Clock.h:26
static time_point now() noexcept
Returns the current time, with the highest resolution available.
Definition: Clock.cpp:46
__int64 int64_t
Definition: rptypes.h:49
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
static constexpr bool is_steady
Definition: Clock.h:28
std::ratio< 1, 10000000 > period
Definition: Clock.h:24



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020