Mercurial Hosting > quicktimer
annotate quicktimer.c @ 3:bdd83d6807d5 default tip
Autmatic Win32 Porting
author | VilyaemKenyaz |
---|---|
date | Thu, 28 Sep 2023 13:22:04 -0400 |
parents | 0dbfb504309e |
children |
rev | line source |
---|---|
1
5725e5313328
Almost functional, need to interpret arg correctly, also ugly system() usage
VilyaemKenyaz
parents:
0
diff
changeset
|
1 // Quicktimer by William King, makes a quick timer |
0 | 2 |
3 #include <stdio.h> | |
4 #include <stdlib.h> | |
3 | 5 //#include <string.h> |
6 //#include <stdbool.h> | |
7 //#include <time.h> | |
0 | 8 |
9 | |
3 | 10 void main(int argc, char* argv[]){ |
11 //unsigned int timeleft; | |
12 if (argc == 1){ | |
13 puts("QuickTimer by Vilyaem peepsoftgames.github.io thekenyaz@yandex.com\n Usage:\n quicktimer (unsigned int seconds)\n"); | |
14 exit(1); | |
15 } | |
16 /* | |
17 if(clock == -1){ | |
18 puts("Quicktimer does not have access to the time, clock_t clock is -1!\n"); | |
19 exit(2); | |
20 } | |
21 */ | |
22 unsigned int timeleft = atoi(argv[1]); | |
23 printf("Starting Quicktimer Ctrl-C to stop. Time left %d \n", timeleft); | |
24 | |
25 while (timeleft != 0){ | |
26 timeleft -= 1; | |
27 printf("Time left: %d\n", timeleft); | |
28 sleep(1); | |
29 } | |
30 printf("Timer has finished, enjoy your day. Glory to the Father, the Son, and the Holy Spirit\n"); | |
31 exit(0); | |
1
5725e5313328
Almost functional, need to interpret arg correctly, also ugly system() usage
VilyaemKenyaz
parents:
0
diff
changeset
|
32 } |