MCPcopy Create free account
hub / github.com/EasyRPG/Player / BM_SwitchOp

Function BM_SwitchOp

bench/switches.cpp:15–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14template <typename F>
15static void BM_SwitchOp(benchmark::State& state, F&& op) {
16 auto s = make();
17 int i = 0;
18 for (auto _: state) {
19 op(s, i + 1, i);
20 i = (i + 1) % max_sws;
21 }
22}
23
24static void BM_SwitchGet(benchmark::State& state) {
25 volatile int x = 0;

Callers 5

BM_SwitchGetFunction · 0.85
BM_SwitchSetFunction · 0.85
BM_SwitchFlipFunction · 0.85
BM_SwitchSetRangeFunction · 0.85
BM_SwitchFlipRangeFunction · 0.85

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected