3bc5b2c0a125e01a16f947ab9d1087a8adc654d6
1 /* $Id: alive.c,v 1.1 2001/03/18 20:20:13 ea Exp $
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 L
"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
);