MCPcopy Create free account
hub / github.com/ArashPartow/exprtk / run_native_benchmark

Function run_native_benchmark

exprtk_benchmark.cpp:121–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120template <typename T, typename NativeFunction>
121void run_native_benchmark(T& x, T& y, NativeFunction f, const std::string& expr_string)
122{
123 T total = T(0);
124 unsigned int count = 0;
125
126 exprtk::timer timer;
127 timer.start();
128
129 for (x = global_lower_bound_x; x <= global_upper_bound_x; x += global_delta)
130 {
131 for (y = global_lower_bound_y; y <= global_upper_bound_y; y += global_delta)
132 {
133 total += f(x,y);
134 ++count;
135 }
136 }
137
138 timer.stop();
139
140 if (T(0) != total)
141 printf("[native] Total Time:%12.8f Rate:%14.3fevals/sec Expression: %s\n",
142 timer.time(),
143 count / timer.time(),
144 expr_string.c_str());
145 else
146 printf("run_native_benchmark() - Error running benchmark for expression: %s\n",expr_string.c_str());
147}
148
149template <typename T>
150bool run_parse_benchmark(exprtk::symbol_table<T>& symbol_table)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected