run_timer_example.cpp 541 B

12345678910111213141516171819202122
  1. // run_timer_example.cpp ---------------------------------------------------//
  2. // Copyright Beman Dawes 2006, 2008
  3. // Copyright 2009/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. // See http://www.boost.org/libs/chrono for documentation.
  7. #include <boost/chrono/process_times.hpp>
  8. #include <cmath>
  9. int main()
  10. {
  11. boost::chrono::run_timer t;
  12. for ( long i = 0; i < 10000; ++i )
  13. std::sqrt( 123.456L ); // burn some time
  14. return 0;
  15. }