diff --git a/libspinscale b/libspinscale index a14d622..ca2ccca 160000 --- a/libspinscale +++ b/libspinscale @@ -1 +1 @@ -Subproject commit a14d622eaf2c2e6a40c958e7d735ccd47d6e6d51 +Subproject commit ca2cccaa9c79f625584569d19d5c0a55445868d2 diff --git a/stimBuffApis/livoxGen1/pcloudStimulusProducer.cpp b/stimBuffApis/livoxGen1/pcloudStimulusProducer.cpp index f663831..6d74b04 100644 --- a/stimBuffApis/livoxGen1/pcloudStimulusProducer.cpp +++ b/stimBuffApis/livoxGen1/pcloudStimulusProducer.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include #include #include #include @@ -19,6 +21,10 @@ #define SMO_DEBUG_PCLOUD_AMBIENCE_INTRIN 0 #endif +#ifndef SMO_PRINT_PCLOUD_STAGE_DURATIONS +#define SMO_PRINT_PCLOUD_STAGE_DURATIONS 1 +#endif + namespace smo { namespace stim_buff { @@ -708,14 +714,29 @@ public: } #endif -#if 0 - // Print execution durations - auto assemblyDuration = pcloudProducer.ioUringAssemblyEngine.getAssemblyDuration(); - auto compactDuration = pcloudProducer.openClCollatingAndMeshingEngine.getCompactKernelDuration(); - auto collateDuration = pcloudProducer.openClCollatingAndMeshingEngine.getCollateKernelDuration(); - std::cout << __func__ << ": Successfully compacted and collated frame: assemblyDuration=" << assemblyDuration.count() - << "ms, compactKernelDuration=" << compactDuration.count() - << "ms, collateKernelDuration=" << collateDuration.count() << "ms" << std::endl; +#if SMO_PRINT_PCLOUD_STAGE_DURATIONS + const auto logNow = std::chrono::system_clock::now(); + const std::time_t logTime = + std::chrono::system_clock::to_time_t(logNow); + const auto logSubsecMs = + std::chrono::duration_cast( + logNow.time_since_epoch()) % 1000; + auto assemblyDuration = + pcloudProducer.ioUringAssemblyEngine.getAssemblyDuration(); + auto compactDuration = + pcloudProducer.openClCollatingAndMeshingEngine + .getCompactKernelDuration(); + auto collateDuration = + pcloudProducer.openClCollatingAndMeshingEngine + .getCollateKernelDuration(); + std::cout << std::put_time(std::localtime(&logTime), "%T") + << '.' << std::setfill('0') << std::setw(3) + << logSubsecMs.count() << ' ' + << __func__ << ": stage durations: assembly=" + << assemblyDuration.count() + << "ms, compactKernel=" << compactDuration.count() + << "ms, collateKernel=" << collateDuration.count() + << "ms" << std::endl; #endif }