Skip to content

Instantly share code, notes, and snippets.

@OlivierLDff
Created February 5, 2020 16:58
Show Gist options
  • Save OlivierLDff/263fa117804d3926b27c71243ec18b68 to your computer and use it in GitHub Desktop.
Save OlivierLDff/263fa117804d3926b27c71243ec18b68 to your computer and use it in GitHub Desktop.
#include <chrono>
#include <cstdint>
std::uint64_t now() const
{
const auto timeNow = std::chrono::system_clock::now();
const auto timeMs = std::chrono::duration_cast<std::chrono::milliseconds>(timeNow.time_since_epoch());
const auto timestamp = timeMs.count();
return timestamp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment