summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2020-12-03 14:47:35 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2020-12-03 14:47:35 +0100
commit53a4135160e973bd535c69ab5cf7784aff173494 (patch)
treed818e035e8738c4ddc1907978b31c85a026c0d00
parent87c791bee874ff132017c31f464a854bf8ea8817 (diff)
downloadtdde25-53a4135160e973bd535c69ab5cf7784aff173494.tar.gz
timing formattingtiming
-rw-r--r--algorithms.py4
-rw-r--r--store.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/algorithms.py b/algorithms.py
index d0988ee..78aac94 100644
--- a/algorithms.py
+++ b/algorithms.py
@@ -31,7 +31,7 @@ def get_closest_node_id(nodes, source_node):
min_node = node_id
min_value = length
- print(f"Found the closest node in {time.monotonic() - start} s")
+ print(f"Found the closest node in {time.monotonic() - start:.3} s")
return min_node
@@ -51,7 +51,7 @@ def find_shortest_path(nodes, source_id, target_id):
walk_end = walk[-1]
if walk_end == target_id:
# you have reached your destination
- print(f"Found a path in {time.monotonic() - start} s")
+ print(f"Found a path in {time.monotonic() - start:.3} s")
return walk
if walk_end in visited:
# there exists a shorter walk to walk_end
diff --git a/store.py b/store.py
index ba2e4ef..e7c1018 100644
--- a/store.py
+++ b/store.py
@@ -51,7 +51,7 @@ def extract_osm_nodes(f_name):
if not node.neighbours:
del nodes[node_id]
- print(f"Extracted {len(nodes)} nodes in {time.monotonic() - start} s")
+ print(f"Extracted {len(nodes)} nodes in {time.monotonic() - start:.3} s")
return nodes