4 #include "boost/date_time/posix_time/posix_time.hpp"
6 #define BOOST_AUTO_TEST_MAIN
7 #include <boost/test/auto_unit_test.hpp>
9 using namespace boost::unit_test;
13 BOOST_AUTO_TEST_CASE( testboosttime1 )
19 boost::posix_time::ptime now
20 = boost::posix_time::microsec_clock::local_time();
21 //std::cout << now << std::endl;
25 boost::posix_time::ptime then
26 = boost::posix_time::microsec_clock::local_time();
27 //std::cout << then << std::endl;
29 boost::posix_time::time_period period(now, then);
30 //std::cout << period << std::endl;
32 boost::posix_time::time_duration duration = then - now;
33 //std::cout << duration << std::endl;
35 BOOST_CHECK (duration.total_seconds() == 1);
36 BOOST_CHECK (duration.fractional_seconds() > 0);
39 catch (std::exception &e) {
40 std::cout << e.what() << "\n";
51 * indent-tabs-mode: nil
53 * vim: shiftwidth=4 tabstop=8 expandtab