From f02ac2c933a33a363035ae478071759f87048e92 Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Sun, 2 Feb 2020 13:22:53 -0500
Subject: added timer
---
timer.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 timer.c
diff --git a/timer.c b/timer.c
new file mode 100644
index 0000000..7000727
--- /dev/null
+++ b/timer.c
@@ -0,0 +1,17 @@
+#include
+#include
+
+int main(){
+ int min; int sec;
+ printf("Input #minutes:#seconds ");
+ scanf("%d:%d", &min, &sec);
+ printf("\n");
+ int time = min*60 + sec;
+ for (int i = 1; i<=time; i++){
+ printf("%d:%02d/%d:%02d\r", (i-i%60)/60, i%60, min, sec);
+ fflush(stdout);
+ sleep(1);
+ }
+ printf("\n");
+ return 0;
+}
--
cgit