From 2280312501aa7ad34ab9fccd353e0036b1fd8038 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 27 Oct 2013 11:29:34 -0400 Subject: [PATCH] Timestamp added --- Timestamp.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Timestamp.h diff --git a/Timestamp.h b/Timestamp.h new file mode 100644 index 00000000..f1775dcb --- /dev/null +++ b/Timestamp.h @@ -0,0 +1,26 @@ +#ifndef TIMESTAMP_H__ +#define TIMESTAMP_H__ + +#include +#include + +namespace i2p +{ +namespace util +{ + inline uint64_t GetMillisecondsSinceEpoch () + { + return std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count (); + } + + inline uint32_t GetHoursSinceEpoch () + { + return std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()).count (); + } +} +} + +#endif +