Fix std::max() call in Compression.cpp
[folly.git] / folly / docs / Benchmark.md
index 2273a7830cd8456f9471489487930dcaf97b0e61..6ac92df0e93667b13b7060466dbdabee5a4b42fd 100644 (file)
@@ -16,8 +16,8 @@ build (either directly or packaged with a library).
 Using `folly/Benchmark.h` is very simple. Here's an example:
 
 ``` Cpp
-    #include "folly/Benchmark.h"
-    #include "folly/Foreach.h"
+    #include <folly/Benchmark.h>
+    #include <folly/Foreach.h>
     #include <vector>
     using namespace std;
     using namespace folly;
@@ -70,8 +70,8 @@ passed by the framework down to the function. The type of the count is
 implicitly `unsigned`. Consider a slightly reworked example:
 
 ``` Cpp
-    #include "folly/Benchmark.h"
-    #include "folly/Foreach.h"
+    #include <folly/Benchmark.h>
+    #include <folly/Foreach.h>
     #include <vector>
     using namespace std;
     using namespace folly;
@@ -126,8 +126,8 @@ front insertion for a vector as a baseline and see how back insertion
 compares with it:
 
 ``` Cpp
-    #include "folly/Benchmark.h"
-    #include "folly/Foreach.h"
+    #include <folly/Benchmark.h>
+    #include <folly/Foreach.h>
     #include <vector>
     using namespace std;
     using namespace folly;
@@ -178,10 +178,24 @@ group or for whatever reason), use `BENCHMARK_DRAW_LINE()`. The line
 fulfills a purely aesthetic role; it doesn't interact with
 measurements in any way.
 
+``` Cpp
+    BENCHMARK(foo) {
+      Foo foo;
+      foo.doSomething();
+    }
+
+    BENCHMARK_DRAW_LINE();
+
+    BENCHMARK(bar) {
+      Bar bar;
+      bar.doSomething();
+    }
+```
+
 ### Suspending a benchmark
 ***
 
-Sometimes benchmarking code must to some preparation work that is
+Sometimes benchmarking code must do some preparation work that is
 physically inside the benchmark function, but should not take part to
 its time budget. To temporarily suspend the benchmark, use the
 pseudo-statement `BENCHMARK_SUSPEND` as follows: