diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-16 23:02:27 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-16 23:02:27 +0300 |
| commit | 22b285ffc4345bee05772509a60fb77fb90d16a0 (patch) | |
| tree | d981ffb1951028423fb4c832166b4efde6fe8029 /main.c | |
| parent | 7dfb37936206de02e9a8c0ef5a3e0593aa535cd1 (diff) | |
| download | astar-22b285ffc4345bee05772509a60fb77fb90d16a0.tar.xz | |
Add pathfinding timing
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 */ |
