From c6b0f3a4e7d1b3de852f4b73a9582c613a30f7d0 Mon Sep 17 00:00:00 2001
From: oboulle <olivier.boulle@inria.fr>
Date: Mon, 26 Aug 2024 14:43:46 +0200
Subject: [PATCH] timer time

---
 partitioning/fast_clustering_t.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/partitioning/fast_clustering_t.cpp b/partitioning/fast_clustering_t.cpp
index 3d7d6f5..50f4f32 100755
--- a/partitioning/fast_clustering_t.cpp
+++ b/partitioning/fast_clustering_t.cpp
@@ -73,6 +73,8 @@ void process_file_part(const std::string& input_filename, int part_id, int start
     */
 
     std::cout << "thread " << part_id << " for lines " << start_line << " to " << end_line << std::endl;
+    auto start = std::chrono::high_resolution_clock::now();
+
 
     std::ifstream input_read_file(input_filename);
     if (!input_read_file.is_open()) {
@@ -138,6 +140,10 @@ void process_file_part(const std::string& input_filename, int part_id, int start
 
     }
     input_read_file.close();
+    // end the timer and print the elapsed time
+    auto end = std::chrono::high_resolution_clock::now();
+    std::chrono::duration<double> elapsed = end - start;
+    std::cout << elapsed.count() << "s for thread " << part_id << std::endl;
 }
 
 
-- 
GitLab