Move all C++ tests to cpp.

This commit is contained in:
2014-05-31 22:55:50 +04:00
parent 1c1c6fe543
commit 7cdff553c8
52 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#include <iostream>
#include <exception>
#include <string>
#include <chrono>
#include <thread>
#include <boost/chrono/process_cpu_clocks.hpp>
int main ( void )
{try{
boost::chrono::process_cpu_clock clock;
boost::chrono::process_cpu_clock::time_point b = clock.now();
std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
boost::chrono::process_cpu_clock::time_point e = clock.now();
boost::chrono::process_cpu_clock::duration d = e - b;
auto times = d.count();
std::cout << times.real / 1e+9 << std::endl;
std::cout << times.user / 1e+9 << std::endl;
std::cout << times.system / 1e+9 << std::endl;
return 0;
}
catch ( const std::exception& e )
{
std::cerr << std::endl
<< "std::exception(\"" << e.what() << "\")." << std::endl;
}
catch ( ... )
{
std::cerr << std::endl
<< "unknown exception." << std::endl;
}}