diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2020-12-03 14:47:35 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2020-12-03 14:47:35 +0100 |
| commit | 53a4135160e973bd535c69ab5cf7784aff173494 (patch) | |
| tree | d818e035e8738c4ddc1907978b31c85a026c0d00 | |
| parent | 87c791bee874ff132017c31f464a854bf8ea8817 (diff) | |
| download | tdde25-timing.tar.gz | |
timing formattingtiming
| -rw-r--r-- | algorithms.py | 4 | ||||
| -rw-r--r-- | store.py | 2 |
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 @@ -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 |
