From e60561a779234aa8a5e33d7c5e0711c419e9e57f Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Mon, 9 Mar 2015 14:56:47 -0400 Subject: [PATCH] Force static initialization of walltime. --- src/benchmark.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/benchmark.cc b/src/benchmark.cc index 97464c0a..ac64670f 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -1280,6 +1280,9 @@ void RunSpecifiedBenchmarks(const BenchmarkReporter* reporter /*= nullptr*/) { void Initialize(int* argc, const char** argv) { internal::ParseCommandLineFlags(argc, argv); internal::SetLogLevel(FLAGS_v); + // Ensure walltime is initialized by a single thread by forcing the + // initialization. + walltime::Now(); internal::Benchmark::MeasureOverhead(); }