// french.cpp ----------------------------------------------------------// // Copyright 2010 Howard Hinnant // Copyright 2011 Vicente J. Botet Escriba // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt // Adapted to Boost from the original Hawards's code #include //#include #include #include #include int main() { boost::chrono::milliseconds ms(2500); std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; std::cout << boost::chrono::floor(ms).count() << " seconds\n"; std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; std::cout << boost::chrono::round(ms).count() << " seconds\n"; std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; std::cout << boost::chrono::ceil(ms).count() << " seconds\n"; std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; ms = boost::chrono::milliseconds(2516); std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; typedef boost::chrono::duration > frame_rate; std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; std::cout << boost::chrono::floor(ms).count() << " [1/30] seconds\n"; std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; std::cout << boost::chrono::round(ms).count() << " [1/30] seconds\n"; std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; std::cout << boost::chrono::ceil(ms).count() << " [1/30] seconds\n"; std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl; return 0; }