Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 5ff1563

Browse files
authored
Speed up SetTimestamp benchmark. (#402)
Move the proto constructor out of the loop.
1 parent 2917fcc commit 5ff1563

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

opencensus/common/internal/timestamp_benchmark.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace {
2222

2323
void BM_SetTimestamp(benchmark::State& state) {
2424
absl::Time t = absl::Now();
25+
google::protobuf::Timestamp proto;
2526
for (auto _ : state) {
26-
google::protobuf::Timestamp proto;
2727
::opencensus::common::SetTimestamp(t, &proto);
2828
}
2929
}

0 commit comments

Comments
 (0)