]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/chrono/example/run_timer_example2.cpp
1 // run_timer_example.cpp ---------------------------------------------------//
3 // Copyright Beman Dawes 2006, 2008
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
8 // See http://www.boost.org/libs/chrono for documentation.
10 #include <boost/chrono/process_times.hpp>
13 int main( int argc
, char * argv
[] )
15 const char * format
= argc
> 1 ? argv
[1] : "%t cpu seconds\n";
16 int places
= argc
> 2 ? std::atoi( argv
[2] ) : 2;
18 boost::chrono::run_timer
t( format
, places
);
20 for ( long i
= 0; i
< 10000; ++i
)
21 std::sqrt( 123.456L ); // burn some time