From 8e8c103b3490a4636b652fb6555c40cd39fc1649 Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 1 Jan 2019 18:31:18 +0000 Subject: router1: Print route time Signed-off-by: David Shah --- common/router1.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/router1.cc b/common/router1.cc index cbc0df90..0dbbfb17 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -19,6 +19,7 @@ #include #include +#include #include "log.h" #include "router1.h" @@ -752,6 +753,7 @@ bool router1(Context *ctx, const Router1Cfg &cfg) log_break(); log_info("Routing..\n"); ctx->lock(); + auto rstart = std::chrono::high_resolution_clock::now(); log_info("Setting up routing queue.\n"); @@ -803,7 +805,9 @@ bool router1(Context *ctx, const Router1Cfg &cfg) router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size())); log_info("Routing complete.\n"); + auto rend = std::chrono::high_resolution_clock::now(); ctx->yield(); + log_info("Route time %.02fs\n", std::chrono::duration(rend - rstart).count()); #ifndef NDEBUG router.check(); -- cgit v1.2.3