| 1 | #include <grass/glocale.h> |
| 2 | #include "global.h" |
| 3 | |
| 4 | int report(time_t rectify, int ok) |
| 5 | { |
| 6 | int minutes, hours; |
| 7 | time_t seconds; |
| 8 | long ncells; |
| 9 | |
| 10 | G_message("%s", ok ? _("complete") : _("failed")); |
| 11 | |
| 12 | if (!ok) |
| 13 | return 1; |
| 14 | |
| 15 | seconds = rectify; |
| 16 | minutes = seconds / 60; |
| 17 | hours = minutes / 60; |
| 18 | minutes -= hours * 60; |
| 19 | ncells = target_window.rows * target_window.cols; |
| 20 | G_verbose_message(_("%d rows, %d cols (%ld cells) completed in"), |
| 21 | target_window.rows, target_window.cols, ncells); |
| 22 | if (hours) |
| 23 | G_verbose_message(_("%d:%02d:%02d hours"), hours, minutes, |
| 24 | (int)(seconds % 60)); |
| 25 | else |
| 26 | G_verbose_message(_("%d:%02d minutes"), minutes, (int)(seconds % 60)); |
| 27 | if (seconds) |
| 28 | G_verbose_message(_("%.1f cells per minute"), |
| 29 | (60.0 * ncells) / ((double)seconds)); |
| 30 | |
| 31 | G_message("-----------------------------------------------"); |
| 32 | |
| 33 | return 1; |
| 34 | } |