From 386c7dc3f41a45a1454b2ebba0fbf6a608a33540 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 10 Jul 2020 20:03:31 +0200 Subject: [PATCH] Fix calculation --- .../osmand/plus/routing/RouteCalculationResult.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java index 46ceaf70ea..e70752b7f1 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteCalculationResult.java @@ -140,9 +140,13 @@ public class RouteCalculationResult { OsmandApplication ctx, boolean leftSide, RoutingContext rctx, List waypoints, ApplicationMode mode) { if (rctx != null) { this.routingTime = rctx.routingTime; - this.visitedSegments = rctx.visitedSegments; - this.loadedTiles = rctx.loadedTiles; - this.calculateTime = (float) (((System.nanoTime() - rctx.timeToCalculate) / 1e6) / 1000f); + this.visitedSegments = rctx.getVisitedSegments(); + this.loadedTiles = rctx.getLoadedTiles(); + if (rctx.calculationProgress != null) { + this.calculateTime = (float) (rctx.calculationProgress.timeToCalculate / 1.0e9); + } else { + this.calculateTime = 0; + } } else { this.routingTime = 0; this.visitedSegments = 0;