From 22b285ffc4345bee05772509a60fb77fb90d16a0 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Thu, 16 Apr 2026 23:02:27 +0300 Subject: Add pathfinding timing --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 4577fca..9668236 100644 --- a/main.c +++ b/main.c @@ -23,11 +23,8 @@ - Clean up unused `#include`s - keybinding help screen - 'clean' rendering mode, without all the ugly shit - - time - Comments */ -/* FIXME: Costs are broken */ - void sigint_handler(int sig) { (void)sig; /* We know it's a SIGINT */ endwin(); @@ -144,7 +141,7 @@ int main(int argc, char **argv) { if (bmp_only) { map_to_bmp(map, width, height, start_pos, end_pos, path, visited, bmp_filename); - printf("Wrote the bmp to %s\n", bmp_filename); + printf("Wrote the bmp to %s. Pathfinding took %f seconds\n", bmp_filename, path_time); exit(0); } @@ -282,6 +279,9 @@ int main(int argc, char **argv) { path = path_func(dirs, map, cell_costs, width, height, start_pos, end_pos, visited, anim); } break; + case 't': + set_message("%f seconds", path_time); print_message(height); + break; case 'c': /* Load a cost file */ curs_set(2); /* Show the cursor */ -- cgit v1.2.3