aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--colour.h3
-rw-r--r--sand-leek.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/colour.h b/colour.h
index 82d41e4..2fe75c2 100644
--- a/colour.h
+++ b/colour.h
@@ -24,7 +24,8 @@
#define COLOUR_BOLD_OFF ANSI_ESC"22m"
#define COLOUR_OFF ANSI_ESC"39m"
-
#define COLOUR_ALL_OFF ANSI_ESC"0m"
+#define COLOUR_ERASE ANSI_ESC"2K"
+
#endif
diff --git a/sand-leek.c b/sand-leek.c
index d53e524..edf64f1 100644
--- a/sand-leek.c
+++ b/sand-leek.c
@@ -334,12 +334,14 @@ monitor_progress(unsigned long volatile *khashes, int thread_count) {
remaining_unit = "year";
}
- iprintf("[%02d:%02d:%02d:%02d]: %.2f %s hashes%s. Now ~%lu kH/s (%.2f kH/s/thread). Maybe %ld %s%s left \r",
+ iprintf_bare(COLOUR_ERASE);
+ iprintf("[%02d:%02d:%02d:%02d]: %.2f %s hashes%s. Now ~%lu kH/s (%.2f kH/s/thread). Maybe %ld %s%s %s\r",
days, hours, minutes, seconds,
hashes_nice, hashes_nice_unit, (hashes_nice > 1000 ? " (!!)" : ""),
total_khashes - last_total_khashes,
(double)(total_khashes - last_total_khashes) / thread_count,
- remaining, remaining_unit, (remaining == 1 ? "" : "s" )
+ labs(remaining), remaining_unit, (labs(remaining) == 1 ? "" : "s" ),
+ (remaining < 0 ? "overdue" : "left")
);
sleep(1);
loops++;