router1: Print route time
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
0ca0af6c72
commit
8e8c103b34
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
@ -752,6 +753,7 @@ bool router1(Context *ctx, const Router1Cfg &cfg)
|
|||||||
log_break();
|
log_break();
|
||||||
log_info("Routing..\n");
|
log_info("Routing..\n");
|
||||||
ctx->lock();
|
ctx->lock();
|
||||||
|
auto rstart = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
log_info("Setting up routing queue.\n");
|
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,
|
router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup,
|
||||||
int(router.arc_queue.size()));
|
int(router.arc_queue.size()));
|
||||||
log_info("Routing complete.\n");
|
log_info("Routing complete.\n");
|
||||||
|
auto rend = std::chrono::high_resolution_clock::now();
|
||||||
ctx->yield();
|
ctx->yield();
|
||||||
|
log_info("Route time %.02fs\n", std::chrono::duration<float>(rend - rstart).count());
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
router.check();
|
router.check();
|
||||||
|
Loading…
Reference in New Issue
Block a user