Skip to content

Instantly share code, notes, and snippets.

@meshula
Created March 26, 2018 20:30
Show Gist options
  • Save meshula/43082c58d73bc3c54060fb0466d4032f to your computer and use it in GitHub Desktop.
Save meshula/43082c58d73bc3c54060fb0466d4032f to your computer and use it in GitHub Desktop.
C++14 & greater
// Convert a timepoint to seconds
MyTimePoint tp = whatever();
double x = std::chrono::time_point_cast<std::chrono::duration<double>>(tp).time_since_epoch().count();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment