Browse Source

Timestamp added

pull/6/head
orignal 11 years ago
parent
commit
2280312501
  1. 26
      Timestamp.h

26
Timestamp.h

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
#ifndef TIMESTAMP_H__
#define TIMESTAMP_H__
#include <inttypes.h>
#include <chrono>
namespace i2p
{
namespace util
{
inline uint64_t GetMillisecondsSinceEpoch ()
{
return std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::system_clock::now().time_since_epoch()).count ();
}
inline uint32_t GetHoursSinceEpoch ()
{
return std::chrono::duration_cast<std::chrono::hours>(
std::chrono::system_clock::now().time_since_epoch()).count ();
}
}
}
#endif
Loading…
Cancel
Save