MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / time_op

Function time_op

examples/sort/bench_stable_sort.cpp:274–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272
273template <typename T, typename Op>
274double time_op(const std::vector<T> & seed, int iters, Op op) {
275 using clk = std::chrono::steady_clock;
276 auto t0 = clk::now();
277 for (int i = 0; i < iters; i++) { std::vector<T> a = seed; op(a); }
278 auto t1 = clk::now();
279 return double(std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count()) / double(iters);
280}
281
282template <typename T, typename Op>
283double bench_one(const char * name, Pattern pat, const std::vector<T> & seed, int iters, Op op) {

Callers 1

bench_oneFunction · 0.70

Calls 2

opFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected