Skip to content

Commit

Permalink
fix: beautify output format
Browse files Browse the repository at this point in the history
  • Loading branch information
LaoshuBaby committed Mar 2, 2024
1 parent 00f7ac8 commit 00ee453
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/yuheng/plugin/viz_folium/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def display(self, **kwargs) -> None:
)
work_burden_report_node_interval = 1000
work_burden_report_way_interval = 15
work_burden_report_large_data = 0.5
work_burden_report_large_data = 1.5
# node
time_node_start = time.time()
work_burden_node_count = 0
Expand All @@ -183,13 +183,13 @@ def display(self, **kwargs) -> None:
"[time] display "
+ str(work_burden_node_count)
+ " node use "
+ str(time_node_this - time_node_start)
+ str(round(time_node_this - time_node_start, 3))
+ " s"
)
time_node_end = time.time()
print(
"[time] display **all** node use "
+ str(time_node_end - time_node_start)
+ str(round(time_node_end - time_node_start, 3))
+ " s"
)
# way
Expand Down Expand Up @@ -217,20 +217,22 @@ def display(self, **kwargs) -> None:
"[time] display "
+ str(work_burden_way_count)
+ " way use "
+ str(time_way_this - time_way_start)
+ str(round(time_way_this - time_way_start))
+ " s"
)
# inspect large data (long way)
if (
time_this_way_end - time_this_way_start
) >= work_burden_report_large_data:
print(
f"[time] way {obj.id} have {len(obj.nds)} node and cause time longer than {work_burden_report_large_data} s"
f"[time] w{obj.id} ({round(time_this_way_end - time_this_way_start,3)}s) "
f"have {len(obj.nds)} node and cause time "
f"longer than {work_burden_report_large_data} s"
)
time_way_end = time.time()
print(
"[time] display **all** way use "
+ str(time_way_end - time_way_start)
+ str(round(time_way_end - time_way_start, 3))
+ " s"
)

Expand All @@ -240,7 +242,7 @@ def display(self, **kwargs) -> None:
time_save_html_end = time.time()
print(
"[time] save html use "
+ str(time_save_html_end - time_save_html_start)
+ str(round(time_save_html_end - time_save_html_start, 3))
+ " s"
)
# webbrowser.open(
Expand Down

0 comments on commit 00ee453

Please sign in to comment.