Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:03:54

0001 // -*- C++ -*-
0002 //
0003 // Package:     Subsystem/Package
0004 // Class  :     TimingServiceBase
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Wed, 11 Jun 2014 15:08:00 GMT
0011 //
0012 
0013 // system include files
0014 #include <sys/resource.h>
0015 #include <sys/time.h>
0016 
0017 // user include files
0018 #include "FWCore/Utilities/interface/TimingServiceBase.h"
0019 
0020 using namespace edm;
0021 //
0022 // constants, enums and typedefs
0023 //
0024 double TimingServiceBase::s_jobStartTime = 0.0;
0025 
0026 void TimingServiceBase::jobStarted() {
0027   if (0.0 == s_jobStartTime) {
0028     struct timeval t;
0029     if (gettimeofday(&t, nullptr) < 0) {
0030       return;
0031     }
0032     s_jobStartTime = static_cast<double>(t.tv_sec) + (static_cast<double>(t.tv_usec) * 1E-6);
0033   }
0034 }
0035 
0036 //
0037 // constructors and destructor
0038 //
0039 TimingServiceBase::TimingServiceBase() {}
0040 
0041 TimingServiceBase::~TimingServiceBase() {}