mirror of
https://github.com/boostorg/chrono.git
synced 2025-05-11 13:14:04 +00:00
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
// 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
|
|
|
|
#if defined BOOST_CHRONO_IO_V1_DONT_PROVIDE_DEPRECATED
|
|
#undef BOOST_CHRONO_IO_V1_DONT_PROVIDE_DEPRECATED
|
|
#endif
|
|
|
|
#include <boost/chrono/chrono_io.hpp>
|
|
#include <boost/chrono/process_cpu_clocks.hpp>
|
|
#include <boost/chrono/thread_clock.hpp>
|
|
#include <iostream>
|
|
#include <locale>
|
|
|
|
int main()
|
|
{
|
|
using std::cout;
|
|
using std::locale;
|
|
using namespace boost;
|
|
using namespace boost::chrono;
|
|
|
|
cout.imbue(locale(locale(), new duration_punct<char>
|
|
(
|
|
duration_style::prefix,
|
|
"secondes", "minutes", "heures",
|
|
"s", "m", "h"
|
|
)));
|
|
hours h(5);
|
|
minutes m(45);
|
|
seconds s(15);
|
|
milliseconds ms(763);
|
|
cout << h << ", " << m << ", " << s << " et " << ms << '\n';
|
|
return 0;
|
|
}
|