-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathformat.cpp
More file actions
39 lines (31 loc) · 950 Bytes
/
format.cpp
File metadata and controls
39 lines (31 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// Created by Ivan Shynkarenka on 28.09.2016
//
#include "benchmark/cppbenchmark.h"
#include "logging/record.h"
using namespace CppLogging;
BENCHMARK("Format(int)")
{
static Record record;
record.Clear();
record.Format("test {} test", context.metrics().total_operations());
}
BENCHMARK("StoreFormat(int)")
{
static Record record;
record.Clear();
record.StoreFormat("test {} test", context.metrics().total_operations());
}
BENCHMARK("Format(int, double, string)")
{
static Record record;
record.Clear();
record.Format("test {}-{}-{} test", context.metrics().total_operations(), context.metrics().total_operations() / 1000.0, context.name());
}
BENCHMARK("StoreFormat(int, double, string)")
{
static Record record;
record.Clear();
record.StoreFormat("test {}-{}-{} test", context.metrics().total_operations(), context.metrics().total_operations() / 1000.0, context.name());
}
BENCHMARK_MAIN()