Skip to content

Instantly share code, notes, and snippets.

@dloman
Created December 20, 2015 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dloman/455071b64ce2bb2f5f14 to your computer and use it in GitHub Desktop.
Save dloman/455071b64ce2bb2f5f14 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <chrono>
using namespace std;
int main()
{
typedef chrono::duration<unsigned long, milli> milliseconds_t;
typedef chrono::duration<unsigned long> seconds_t;
milliseconds_t Milliseconds(11111);
seconds_t Seconds(chrono::duration_cast<seconds_t> (Milliseconds));
cout << Milliseconds.count() << endl;
cout << Seconds.count() << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment