7 HANDLE StandardOutput
= INVALID_HANDLE_VALUE
;
9 DWORD CharactersToWrite
= 0;
10 DWORD WrittenCharacters
= 0;
11 INT d
= 0, h
= 0, m
= 0, s
= 0;
14 main (int argc
, char * argv
[])
16 StandardOutput
= GetStdHandle (STD_OUTPUT_HANDLE
);
17 if (INVALID_HANDLE_VALUE
== StandardOutput
)
19 return (EXIT_FAILURE
);
23 /* Prepare the message and update it */
27 "Alive for %dd %dh %d' %d\" \r",
37 /* suspend the execution for 1s */
39 /* increment seconds */
41 if (60 == s
) { s
= 0; ++ m
; }
42 if (60 == m
) { m
= 0; ++ h
; }
43 if (24 == h
) { h
= 0; ++ d
; }
45 return (EXIT_SUCCESS
);