]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/locale/performance/perf_format.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / locale / performance / perf_format.cpp
1 //
2 // Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 #include <iostream>
9 #include <string>
10 #include <set>
11 #include <ctime>
12 #include <boost/locale.hpp>
13
14 using namespace std;
15 using namespace boost::locale;
16
17 int main(int argc,char **argv)
18 {
19 if(argc!=2) {
20 std::cerr << "Usage backend locale" << std::endl;
21 return 1;
22 }
23 boost::locale::localization_backend_manager mgr = boost::locale::localization_backend_manager::global();
24 mgr.select(argv[1]);
25 generator gen(mgr);
26 std::locale::global(gen(argv[2]));
27 /// Set global locale to requested
28
29 for(int i=0;i<100000;i++) {
30 std::ostringstream ss;
31 for(int j=0;j<5;j++) {
32 ss << boost::locale::as::datetime << std::time(0) <<" "<< boost::locale::as::number << 13456.345 <<"\n";
33 }
34 if(i==0)
35 std::cout << ss.str() << std::endl;
36 }
37
38 }
39 // vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4