diff quicktimer.c @ 3:bdd83d6807d5 default tip

Autmatic Win32 Porting
author VilyaemKenyaz
date Thu, 28 Sep 2023 13:22:04 -0400
parents 0dbfb504309e
children
line wrap: on
line diff
--- a/quicktimer.c	Wed Jul 26 03:46:13 2023 -0400
+++ b/quicktimer.c	Thu Sep 28 13:22:04 2023 -0400
@@ -2,32 +2,31 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
-#include <time.h>
+//#include <string.h>
+//#include <stdbool.h>
+//#include <time.h>
 
 
-int main(int argc, char* argv[]){
-//unsigned int timeleft;
-if (argc == 1){
-printf("QuickTimer by Vilyaem peepsoftgames.github.io thekenyaz@yandex.com\n Usage:\n quicktimer (unsigned int seconds)\n");
-return 1;
-}
-if(clock == -1){
-printf("Quicktimer does not have access to the time, clock_t clock is -1!\n");
-return 2;
+void  main(int argc, char* argv[]){
+	//unsigned int timeleft;
+	if (argc == 1){
+		puts("QuickTimer by Vilyaem peepsoftgames.github.io thekenyaz@yandex.com\n Usage:\n quicktimer (unsigned int seconds)\n");
+		exit(1);
+	}
+	/*
+	   if(clock == -1){
+	   puts("Quicktimer does not have access to the time, clock_t clock is -1!\n");
+	   exit(2);
+	   }
+	   */
+	unsigned int timeleft = atoi(argv[1]);
+	printf("Starting Quicktimer Ctrl-C to stop. Time left %d \n", timeleft);
+
+	while (timeleft != 0){
+		timeleft -= 1; 
+		printf("Time left: %d\n", timeleft);
+		sleep(1);
+	}
+	printf("Timer has finished, enjoy your day. Glory to the Father, the Son, and the Holy Spirit\n");
+	exit(0);
 }
-unsigned int timeleft = atoi(argv[1]);
-printf("Starting Quicktimer Ctrl-C to stop. Time left %d \n", timeleft);
-
-while (timeleft != 0){
-timeleft -= 1; //clock()/CLOCKS_PER_SEC;
-printf("Time left: %d\n", timeleft);
-//system("sleep 1"); // LORD!
-sleep(1);
-
-}
-
-printf("Timer has finished, enjoy your day. Glory to the Father, the Son, and the Holy Spirit\n");
-
-}