3 #include "boost/date_time/posix_time/posix_time.hpp"
5 #define BOOST_AUTO_TEST_MAIN
6 #include <boost/test/auto_unit_test.hpp>
8 using namespace boost::unit_test;
12 BOOST_AUTO_TEST_CASE( testboosttime1 )
18 boost::posix_time::ptime now
19 = boost::posix_time::microsec_clock::local_time();
20 //std::cout << now << std::endl;
24 boost::posix_time::ptime then
25 = boost::posix_time::microsec_clock::local_time();
26 //std::cout << then << std::endl;
28 boost::posix_time::time_period period(now, then);
29 //std::cout << period << std::endl;
31 boost::posix_time::time_duration duration = then - now;
32 //std::cout << duration << std::endl;
34 BOOST_CHECK (duration.total_seconds() == 1);
37 catch (std::exception &e) {
38 std::cout << e.what() << "\n";
49 * indent-tabs-mode: nil
51 * vim: shiftwidth=4 tabstop=8 expandtab