File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,7 @@ namespace edm {
4242
4343 static void jobStarted ();
4444
45- static std::chrono::steady_clock::time_point jobStartTime () { return s_jobStartTime; }
46-
47- private:
48- static std::chrono::steady_clock::time_point s_jobStartTime;
45+ static std::chrono::steady_clock::time_point jobStartTime ();
4946 };
5047} // namespace edm
5148
Original file line number Diff line number Diff line change 1414
1515using namespace edm ;
1616
17- std::chrono::steady_clock::time_point TimingServiceBase::s_jobStartTime;
18-
1917void TimingServiceBase::jobStarted () {
20- if (0 == s_jobStartTime.time_since_epoch ().count ()) {
21- s_jobStartTime = std::chrono::steady_clock::now ();
22- }
18+ // make sure the value has been initialized
19+ (void )jobStartTime ();
20+ }
21+
22+ std::chrono::steady_clock::time_point TimingServiceBase::jobStartTime () {
23+ static const std::chrono::steady_clock::time_point s_jobStartTime = std::chrono::steady_clock::now ();
24+ return s_jobStartTime;
2325}
2426
2527//
You can’t perform that action at this time.
0 commit comments