From 7640702fb174e11a8d126289360b2656ed1864d1 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Tue, 26 May 2020 12:11:45 +0200 Subject: [PATCH] Add stats output to test program --- sf-writer/test/manual/test_sf_writer_recv.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sf-writer/test/manual/test_sf_writer_recv.cpp b/sf-writer/test/manual/test_sf_writer_recv.cpp index ea61e66..f90d8ce 100644 --- a/sf-writer/test/manual/test_sf_writer_recv.cpp +++ b/sf-writer/test/manual/test_sf_writer_recv.cpp @@ -55,6 +55,8 @@ void receive_replay( // "<= stop_pulse_id" because we include the last pulse_id. while(pulse_id <= stop_pulse_id) { + auto start_time = chrono::steady_clock::now(); + for (size_t i_module = 0; i_module < n_modules; i_module++) { auto n_bytes_metadata = zmq_recv( @@ -74,8 +76,13 @@ void receive_replay( if (n_bytes_image != MODULE_N_BYTES) { throw runtime_error("Wrong number of data bytes."); } - } + + auto end_time = chrono::steady_clock::now(); + auto read_us_duration = chrono::duration_cast( + end_time-start_time).count(); + + cout << "sf_writer:read_us " << read_us_duration << endl; } queue.commit();