]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/chrono/doc/stopwatches/hello.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / chrono / doc / stopwatches / hello.qbk
1 [/
2 / Copyright (c) 2009-20012 Vicente J. Botet Escriba
3 /
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 /]
7
8
9 [/=====================]
10 [/section Hello World! ]
11 [/=====================]
12
13 If all you want to do is to time a program's execution, here is a complete program (stopclock_example.cpp):
14
15 #include <boost/chrono_io.hpp>
16 #include <boost/chrono/stopwatches/reporters/stopclock.hpp>
17 #include <cmath>
18
19 int main()
20 {
21 boost::chrono::system_strict_stopclock _;
22
23 for ( long i = 0; i < 10000000; ++i )
24 std::sqrt( 123.456L ); // burn some time
25
26 return 0;
27 }
28
29 Output was:
30
31 0.832 seconds
32
33
34