Open lucabaldini opened 7 years ago
There is now a sensible timing facility in the package---see utils/pChrono.h/cpp.
We should use it consistently throughout. A few places where we're doing funky stuff are
[lbaldini@nblbaldini xpedaq]$ grep "time(NULL)" */*.cpp
daq/pDataCollector.cpp: return static_cast<long int> (time(NULL));
daq/pRunController.cpp: return static_cast<long int> (time(NULL));
quickusb-2.11.10/CQuickUsb.cpp: srand( time(NULL) );
utils/pLoggerChannel.cpp: long int seconds = static_cast<long int> (time(NULL));
xpemon/pEventReader.cpp: return static_cast<long int> (time(NULL));
The logger should now be all set, modulo possible minor tweaks in the formatting.
We still have to use pChrono throughout.
And it would be probably interesting to add the time in seconds (which is the same being provisionally used to timestamp the events) next to the date and time.
On a related note: there's a few places where we latch the system time in s (e.g., pRunController) and it would be nice to have a unified interface capable to latch the time at the ms level.