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 +