Module: check_mk
Branch: master
Commit: 7200dd0133d00abc4320db74d972b97f796b8dc4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7200dd0133d00a…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Feb 14 09:25:57 2017 +0100
Use std::chrono more often, increasing type safety and convenience.
Change-Id: I8904a46ef63697045fe904632fd7bdcad3b9c066
---
livestatus/src/ChronoUtils.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/livestatus/src/ChronoUtils.h b/livestatus/src/ChronoUtils.h
index 9b9b005..ea1dffb 100644
--- a/livestatus/src/ChronoUtils.h
+++ b/livestatus/src/ChronoUtils.h
@@ -47,6 +47,10 @@ inline tm to_tm(std::chrono::system_clock::time_point tp) {
return ret;
}
+inline std::chrono::system_clock::time_point from_tm(tm tp) {
+ return std::chrono::system_clock::from_time_t(mktime(&tp));
+}
+
template <typename Rep, typename Period>
inline timeval to_timeval(std::chrono::duration<Rep, Period> dur) {
using namespace std::chrono;