// // main.cpp // Boost_Test_1 // // Created by Arthur B Coleman on 12/7/15. // Copyright © 2015 Arthur Coleman. All rights reserved. // #include #include #include using namespace boost::chrono; void explore_limits() { typedef duration, hours::period>::type> Years; #ifdef BOOST_CHRONO_HAS_CLOCK_STEADY steady_clock::time_point t1( Years(250)); steady_clock::time_point t2(-Years(250)); #else system_clock::time_point t1( Years(250)); system_clock::time_point t2(-Years(250)); #endif // nanosecond resolution is likely to overflow. "up cast" to microseconds. // The "up cast" trades precision for range. microseconds d = time_point_cast(t1) - time_point_cast(t2); std::cout << d.count() << " microseconds\n"; } int main() { explore_limits(); return 0; }