MCPcopy Create free account
hub / github.com/boostorg/spirit / format_performance_string

Function format_performance_string

workbench/karma/format_performance.cpp:80–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void format_performance_string()
81{
82 using boost::spirit::karma::left_align;
83 using boost::spirit::karma::generate;
84
85 //[karma_format_performance_string
86 std::string generated;
87 std::back_insert_iterator<std::string> sink(generated);
88 //<-
89 util::high_resolution_timer t;
90 //->
91 for (int i = 0; i < NUMITERATIONS; ++i) {
92 generated.clear();
93 generate(sink
94 , '[' << left_align(14)[double3] << left_align(14)[double3] << ']'
95 , 12345.12345, 12345.12345);
96 }
97 //]
98
99 std::cout << "karma (string):\t" << t.elapsed() << std::endl;
100// std::cout << generated << std::endl;
101}
102
103// Boost.Format
104void format_performance_boost_format()

Callers 1

mainFunction · 0.70

Calls 3

elapsedMethod · 0.80
generateFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected