Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:16:06

0001 #include "Timing.h"
0002 
0003 #include <fun4all/Fun4AllReturnCodes.h>
0004 #include <fun4all/SubsysReco.h>  // for SubsysReco
0005 
0006 #include <phool/PHCompositeNode.h>
0007 
0008 Timing::Timing(const std::string &name)
0009   : SubsysReco(name)
0010 {
0011 }
0012 
0013 int Timing::InitRun(PHCompositeNode * /*topNode*/)
0014 {
0015   starttime = time(nullptr);
0016   return Fun4AllReturnCodes::EVENT_OK;
0017 }
0018 
0019 int Timing::process_event(PHCompositeNode * /*topNode*/)
0020 {
0021   call_counter++;
0022   if (call_counter >= calls)
0023   {
0024     time_t difftime = time(nullptr) - starttime;
0025     counter++;
0026     std::cout << "Count " << counter << ", seconds: " << difftime << std::endl;
0027     starttime = time(nullptr);
0028     call_counter = 0;
0029   }
0030   return Fun4AllReturnCodes::EVENT_OK;
0031 }