From efa270becde6c18a0f99556eb7bc9cb5137c7450 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Fri, 14 Jun 2019 13:31:26 +0300
Subject: [PATCH] Output decode times

---
 components/rgbd-sources/src/net.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/components/rgbd-sources/src/net.cpp b/components/rgbd-sources/src/net.cpp
index a52bfea4e..0ce3b1fa2 100644
--- a/components/rgbd-sources/src/net.cpp
+++ b/components/rgbd-sources/src/net.cpp
@@ -64,11 +64,16 @@ NetSource::~NetSource() {
 void NetSource::_recv(const vector<unsigned char> &jpg, const vector<unsigned char> &d) {
 	unique_lock<shared_mutex> lk(host_->mutex());
 
+	auto start = std::chrono::high_resolution_clock::now();
 	cv::imdecode(jpg, cv::IMREAD_COLOR, &rgb_);
 	//Mat(rgb_.size(), CV_16UC1);
 	cv::imdecode(d, cv::IMREAD_UNCHANGED, &depth_);
 	depth_.convertTo(depth_, CV_32FC1, 1.0f/(16.0f*100.0f));
 
+	std::chrono::duration<double> elapsed =
+		std::chrono::high_resolution_clock::now() - start;
+	LOG(INFO) << "ELAPSED DECODE: " << elapsed.count();
+
 	N_--;
 	if (N_ == 0) {
 		N_ += 10;
-- 
GitLab