Ticket #9337: test.cc
File test.cc, 335 bytes (added by , 9 years ago) |
---|
Line | |
---|---|
1 | #include <iostream> |
2 | #include <unistd.h> |
3 | #define BOOST_CHRONO_HEADER_ONLY |
4 | #include <boost/chrono.hpp> |
5 | |
6 | using namespace std; |
7 | using namespace boost::chrono; |
8 | |
9 | int main() { |
10 | process_cpu_clock::time_point start=process_cpu_clock::now(); |
11 | sleep(1); |
12 | process_cpu_clock::time_point stop=process_cpu_clock::now(); |
13 | cout<<stop-start<<endl; |
14 | } |