lucabaldini / xpedaq

Data acquisition software for the X-ray polarimetry explorers
GNU General Public License v2.0
0 stars 0 forks source link

The timestamp in the logger should have at least ms granularity #147

Open lucabaldini opened 7 years ago

lucabaldini commented 7 years ago

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.

lucabaldini commented 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));
lucabaldini commented 7 years ago

The logger should now be all set, modulo possible minor tweaks in the formatting.

We still have to use pChrono throughout.