X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=src%2Fclockloop.c;fp=src%2Fclockloop.c;h=c9e04def3aee4c2e01e4013d3bb060e6ec33dcec;hb=de7ac8e9b85eaec159496976fc65eeec6c332816;hp=0000000000000000000000000000000000000000;hpb=d9872b72a86c684ac587496eb9a1a83de8f2ba0a;p=khome.git diff --git a/src/clockloop.c b/src/clockloop.c new file mode 100644 index 0000000..c9e04de --- /dev/null +++ b/src/clockloop.c @@ -0,0 +1,28 @@ +#include + +#include +#include + +#include + + +#define BS 50 + + +int +main() +{ + time_t t; + char buf[BS]; + + initscr(); + timeout(0); + while (getch() == -1) { + t = time(NULL); + strftime(buf, BS, "%A %Y-%m-%d %H:%M:%S", localtime(&t)); + mvprintw(0, 0, "%s", buf); + refresh(); + } + endwin(); + return 0; +}