File indexing completed on 2025-12-17 09:19:37
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 #include <iostream>
0009
0010 Timing::Timing(const std::string &name)
0011 : SubsysReco(name)
0012 {
0013 }
0014
0015 int Timing::InitRun(PHCompositeNode * )
0016 {
0017 starttime = time(nullptr);
0018 return Fun4AllReturnCodes::EVENT_OK;
0019 }
0020
0021 int Timing::process_event(PHCompositeNode * )
0022 {
0023 call_counter++;
0024 if (call_counter >= calls)
0025 {
0026 time_t difftime = time(nullptr) - starttime;
0027 counter++;
0028 std::cout << "Count " << counter << ", seconds: " << difftime << std::endl;
0029 starttime = time(nullptr);
0030 call_counter = 0;
0031 }
0032 return Fun4AllReturnCodes::EVENT_OK;
0033 }