mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 14:04:25 +00:00
Total uptime length
Conflicts: sgminer.c
This commit is contained in:
parent
d89e53b3db
commit
8f10cbfac5
25
sgminer.c
25
sgminer.c
@ -2361,6 +2361,30 @@ static bool shared_strategy(void)
|
|||||||
wprintw(win, "%s", tmp42); \
|
wprintw(win, "%s", tmp42); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
/* Must be called with curses mutex lock held and curses_active */
|
||||||
|
static void curses_print_uptime(void)
|
||||||
|
{
|
||||||
|
struct timeval now, tv;
|
||||||
|
unsigned int days, hours;
|
||||||
|
div_t d;
|
||||||
|
|
||||||
|
cgtime(&now);
|
||||||
|
timersub(&now, &total_tv_start, &tv);
|
||||||
|
d = div(tv.tv_sec, 86400);
|
||||||
|
days = d.quot;
|
||||||
|
d = div(d.rem, 3600);
|
||||||
|
hours = d.quot;
|
||||||
|
d = div(d.rem, 60);
|
||||||
|
cg_wprintw(statuswin, " - [%u day%c %02d:%02d:%02d]"
|
||||||
|
, days
|
||||||
|
, (days == 1) ? ' ' : 's'
|
||||||
|
, hours
|
||||||
|
, d.quot
|
||||||
|
, d.rem
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Must be called with curses mutex lock held and curses_active */
|
/* Must be called with curses mutex lock held and curses_active */
|
||||||
static void curses_print_status(void)
|
static void curses_print_status(void)
|
||||||
{
|
{
|
||||||
@ -2369,6 +2393,7 @@ static void curses_print_status(void)
|
|||||||
|
|
||||||
wattron(statuswin, A_BOLD);
|
wattron(statuswin, A_BOLD);
|
||||||
cg_mvwprintw(statuswin, line, 0, PACKAGE " " VERSION " - Started: %s", datestamp);
|
cg_mvwprintw(statuswin, line, 0, PACKAGE " " VERSION " - Started: %s", datestamp);
|
||||||
|
curses_print_uptime();
|
||||||
wattroff(statuswin, A_BOLD);
|
wattroff(statuswin, A_BOLD);
|
||||||
|
|
||||||
mvwhline(statuswin, ++line, 0, '-', 80);
|
mvwhline(statuswin, ++line, 0, '-', 80);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user