knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
TimePoint.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_TIME_POINT_H_
7 #define KNOWROB_TIME_POINT_H_
8 
9 #include <ostream>
10 #include <chrono>
11 
12 namespace knowrob {
16  typedef std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds> TimePoint;
17 
18  namespace time {
22  TimePoint now();
23 
28  TimePoint fromSeconds(double seconds);
29 
34  double toSeconds(const TimePoint &timestamp);
35 
41  void write(const TimePoint &tp, std::ostream &os);
42  } // namespace time
43 }
44 
45 #endif //KNOWROB_TIME_POINT_H_
double toSeconds(const TimePoint &timestamp)
Definition: TimePoint.cpp:23
void write(const TimePoint &tp, std::ostream &os)
Definition: TimePoint.cpp:28
TimePoint fromSeconds(double seconds)
Definition: TimePoint.cpp:17
TimePoint now()
Definition: TimePoint.cpp:12
std::chrono::time_point< std::chrono::system_clock, std::chrono::seconds > TimePoint
Definition: TimePoint.h:16