diff OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp @ 1751:946eb7200b82

FastParseVector usage + timing instrumentation guarded by STONE_TIME_BLOCKING_OPS
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 22 Feb 2021 14:57:01 +0100
parents 9ac2a65d4172
children 28979b77ce90
line wrap: on
line diff
--- a/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp	Mon Feb 22 14:56:06 2021 +0100
+++ b/OrthancStone/Sources/Loaders/OrthancMultiframeVolumeLoader.cpp	Mon Feb 22 14:57:01 2021 +0100
@@ -25,6 +25,10 @@
 #include <Endianness.h>
 #include <Toolbox.h>
 
+#if STONE_TIME_BLOCKING_OPS
+# include <boost/date_time/posix_time/posix_time.hpp>
+#endif
+
 namespace OrthancStone
 {
   class OrthancMultiframeVolumeLoader::LoadRTDoseGeometry : public LoaderStateMachine::State
@@ -267,6 +271,10 @@
   void OrthancMultiframeVolumeLoader::CopyPixelDataAndComputeDistribution(
     const std::string& pixelData, std::map<T,uint64_t>& distribution)
   {
+#if STONE_TIME_BLOCKING_OPS
+    boost::posix_time::ptime timerStart = boost::posix_time::microsec_clock::universal_time();
+#endif
+
     ImageBuffer3D& target = volume_->GetPixelData();
       
     const unsigned int bpp = target.GetBytesPerPixel();
@@ -354,6 +362,12 @@
 #endif
       }
     }
+#if STONE_TIME_BLOCKING_OPS
+    boost::posix_time::ptime timerEnd = boost::posix_time::microsec_clock::universal_time();
+    boost::posix_time::time_duration duration = timerEnd - timerStart;
+    int64_t durationMs = duration.total_milliseconds();
+    LOG(WARNING) << "OrthancMultiframeVolumeLoader::CopyPixelDataAndComputeDistribution took " << durationMs << " ms";
+#endif
   }
 
   template <typename T>