From fc93b90164b5255376df545aceeb8acd784fff7c Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Tue, 2 Jun 2020 12:46:54 +0200 Subject: [PATCH] Move initialization in loop --- sf-stream/src/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sf-stream/src/main.cpp b/sf-stream/src/main.cpp index 2adb6c9..6515044 100644 --- a/sf-stream/src/main.cpp +++ b/sf-stream/src/main.cpp @@ -72,9 +72,7 @@ int main (int argc, char *argv[]) uint16_t data_empty [] = { 0, 0, 0, 0}; - rapidjson::Document header(rapidjson::kObjectType); - auto& header_alloc = header.GetAllocator(); - string text_header; + // TODO: Remove stats trash. int stats_counter = 0; @@ -84,6 +82,10 @@ int main (int argc, char *argv[]) while (true) { + rapidjson::Document header(rapidjson::kObjectType); + auto& header_alloc = header.GetAllocator(); + string text_header; + auto start_time = chrono::steady_clock::now(); auto slot_id = queue.read(); @@ -176,7 +178,6 @@ int main (int argc, char *argv[]) shape[1] = 2; } - { rapidjson::StringBuffer buffer; rapidjson::Writer writer(buffer);