From 40ba4fb38336b7ebc26729f69c550cc50b404e7d Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 18 Jan 2025 17:23:13 -0500 Subject: feat: created timetest.c to test some timing stuff --- timetest.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 timetest.c (limited to 'timetest.c') diff --git a/timetest.c b/timetest.c new file mode 100644 index 0000000..a00c5ca --- /dev/null +++ b/timetest.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() { + unsigned int tdelay = 10; + unsigned long curtime; + unsigned long prevtime; + time_t sec; + prevtime = time(&sec); + int swi = 0; + while (1) { + if (swi == 0) { + printf("we are here\n"); + swi = 1; + } + curtime = time(&sec); + if (curtime - prevtime >= tdelay) { + printf("Block\n"); + prevtime = time(&sec); + } + } +} + -- cgit v1.2.3