diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit 8745400ed3bea6ed6c0df765a321e7d0ff938e59
parent 6c7131b6ec1b683c185b1d5e2772c03fa7f694d2
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Tue, 28 Mar 2023 00:32:30 +0200

feat: replace usleep with nanosleep

Diffstat:
Msrc/utils.c | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/utils.c b/src/utils.c @@ -373,21 +373,22 @@ bool go_to(WINDOW* calendar, WINDOW* aside, time_t date, int* cur_pad_pos, struc void* show_progress(void* vargp){ + struct timespec timer = { 0, 70000000 }; WINDOW* header = (WINDOW*) vargp; mvwprintw(header, 0, COLS - CAL_WIDTH - ASIDE_WIDTH - 11, " syncing "); for(;;) { mvwprintw(header, 0, COLS - CAL_WIDTH - ASIDE_WIDTH - 10, "|"); wrefresh(header); - usleep(200000); + nanosleep(&timer, &timer); mvwprintw(header, 0, COLS - CAL_WIDTH - ASIDE_WIDTH - 10, "/"); wrefresh(header); - usleep(200000); + nanosleep(&timer, &timer); mvwprintw(header, 0, COLS - CAL_WIDTH - ASIDE_WIDTH - 10, "-"); wrefresh(header); - usleep(200000); + nanosleep(&timer, &timer); mvwprintw(header, 0, COLS - CAL_WIDTH - ASIDE_WIDTH - 10, "\\"); wrefresh(header); - usleep(200000); + nanosleep(&timer, &timer); } }