We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 43d0e78 + 0b17ae9 commit 195de2cCopy full SHA for 195de2c
1 file changed
test/general_test.cpp
@@ -64,18 +64,13 @@ void test_type_traits() {
64
void test_advanced_timer() {
65
essentials::timer_type t;
66
67
- // Simulate 5 fast runs and 1 slow run (outlier)
+ uint64_t ignore = 0;
68
for (int i = 0; i < 6; ++i) {
69
t.start();
70
- if (i == 0) {
71
- for (int j = 0; j < 1000000; ++j)
72
- ; // Slow run
73
- } else {
74
- for (int j = 0; j < 100; ++j)
75
- ; // Fast run
76
- }
+ for (int j = 0; j < 10000000; ++j) ignore ^= j;
77
t.stop();
78
}
+ essentials::do_not_optimize_away(ignore);
79
80
assert(t.runs() == 6);
81
0 commit comments