Skip to content

Instantly share code, notes, and snippets.

@NaokiKuzumi
Last active August 29, 2015 14:03
Show Gist options
  • Save NaokiKuzumi/c7606d667495904e8703 to your computer and use it in GitHub Desktop.
Save NaokiKuzumi/c7606d667495904e8703 to your computer and use it in GitHub Desktop.
#include <chrono>
#include <iostream>
// compile with -std=c++11 option
int main(){
typedef std::chrono::duration <int,std::ratio<24*60*60> > chomado_year;
std::chrono::hours seven_days(24*7);
std::cout << "7 days is " << std::chrono::duration_cast<chomado_year>(seven_days).count() << " years for chomado" << std::endl;
}
7 days is 7 years for chomado
@NaokiKuzumi
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment