Move bench_volatile_loop to benchmarks/
This commit is contained in:
@@ -190,7 +190,7 @@ add_executable(bench_arena_allocator benchmarks/bench_arena_allocator.cpp
|
|||||||
target_link_libraries(bench_arena_allocator nanobench)
|
target_link_libraries(bench_arena_allocator nanobench)
|
||||||
target_include_directories(bench_arena_allocator PRIVATE src)
|
target_include_directories(bench_arena_allocator PRIVATE src)
|
||||||
|
|
||||||
add_executable(bench_volatile_loop bench_volatile_loop.cpp)
|
add_executable(bench_volatile_loop benchmarks/bench_volatile_loop.cpp)
|
||||||
target_link_libraries(bench_volatile_loop nanobench)
|
target_link_libraries(bench_volatile_loop nanobench)
|
||||||
|
|
||||||
add_executable(
|
add_executable(
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
#include <nanobench.h>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
ankerl::nanobench::Bench().run("volatile loop to 500", [&] {
|
|
||||||
for (volatile int i = 0; i < 800; i = i + 1)
|
|
||||||
;
|
|
||||||
});
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
12
benchmarks/bench_volatile_loop.cpp
Normal file
12
benchmarks/bench_volatile_loop.cpp
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include <nanobench.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
constexpr int loopIterations = 1200;
|
||||||
|
ankerl::nanobench::Bench().run(
|
||||||
|
"volatile loop to " + std::to_string(loopIterations), [&] {
|
||||||
|
for (volatile int i = 0; i < 1200; i = i + 1)
|
||||||
|
;
|
||||||
|
});
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user