mirror of
https://github.com/google/benchmark.git
synced 2025-02-05 08:40:17 +08:00
Update Readme.md
This commit is contained in:
parent
109f528a40
commit
3ef6339971
@ -142,6 +142,14 @@ BENCHMARK(BM_StringCompare)
|
|||||||
->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity();
|
->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The following code will specify asymptotic complexity with a lambda function,
|
||||||
|
that might be used to customize high-order term calculation.
|
||||||
|
|
||||||
|
```c++
|
||||||
|
BENCHMARK(BM_StringCompare)->RangeMultiplier(2)
|
||||||
|
->Range(1<<10, 1<<18)->Complexity([](size_t n)->double{return n; });
|
||||||
|
```
|
||||||
|
|
||||||
### Templated benchmarks
|
### Templated benchmarks
|
||||||
Templated benchmarks work the same way: This example produces and consumes
|
Templated benchmarks work the same way: This example produces and consumes
|
||||||
messages of size `sizeof(v)` `range_x` times. It also outputs throughput in the
|
messages of size `sizeof(v)` `range_x` times. It also outputs throughput in the
|
||||||
|
Loading…
Reference in New Issue
Block a user