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

Function run_exprtk_benchmark

exprtk_benchmark.cpp:88–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87template <typename T>
88void run_exprtk_benchmark(T& x, T& y,
89 exprtk::expression<T>& expression,
90 const std::string& expr_string)
91{
92 T total = T(0);
93 unsigned int count = 0;
94
95 exprtk::timer timer;
96 timer.start();
97
98 for (x = global_lower_bound_x; x <= global_upper_bound_x; x += global_delta)
99 {
100 for (y = global_lower_bound_y; y <= global_upper_bound_y; y += global_delta)
101 {
102 total += expression.value();
103 ++count;
104 }
105 }
106
107 timer.stop();
108
109 if (T(0) != total)
110 printf("[exprtk] Total Time:%12.8f Rate:%14.3fevals/sec Expression: %s\n",
111 timer.time(),
112 count / timer.time(),
113 expr_string.c_str());
114 else
115 printf("run_exprtk_benchmark() - Error running benchmark for expression: %s\n",expr_string.c_str());
116}
117
118template <typename T> struct native;
119

Callers 1

mainFunction · 0.85

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected