#pragma once

#include <chrono>

//--------------------------------------------------------------
inline uint64_t encodeTimepoint(const std::chrono::system_clock::time_point &timepoint)
{
  const auto duration = timepoint.time_since_epoch();
  return static_cast<uint64_t>(duration.count());
}
//--------------------------------------------------------------
inline std::chrono::system_clock::time_point decodeTimepoint(const uint64_t value)
{
  const auto duration = std::chrono::system_clock::duration(static_cast<std::chrono::seconds>(value));
  return std::chrono::system_clock::time_point(duration);
}
//--------------------------------------------------------------
