Microbenchmark example in C++
Requires https://bazel.build/ to be installed.
bazel build //main:main -c opt
bazel run //main:main -c opt
This will generate an output like the following:
------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------
BM_StringConcatV1 519933 ns 518423 ns 1000
BM_StringConcatV2 1717999 ns 1703354 ns 413