io_ex4.cpp 816 B

1234567891011121314151617181920212223242526272829303132
  1. // io_ex1.cpp ----------------------------------------------------------//
  2. // Copyright 2010 Howard Hinnant
  3. // Copyright 2010 Vicente J. Botet Escriba
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // See http://www.boost.org/LICENSE_1_0.txt
  6. /*
  7. This code was adapted by Vicente J. Botet Escriba from Hinnant's html documentation.
  8. Many thanks to Howard for making his code available under the Boost license.
  9. */
  10. #include <boost/chrono/chrono_io.hpp>
  11. #include <iostream>
  12. int main()
  13. {
  14. using std::cout;
  15. using namespace boost;
  16. using namespace boost::chrono;
  17. #ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
  18. typedef time_point<steady_clock, duration<double, ratio<3600> > > T;
  19. T tp = steady_clock::now();
  20. std::cout << tp << '\n';
  21. #endif
  22. return 0;
  23. }
  24. //~ 17.8666 hours since boot