C_dumping-ground/timingtest.c

34 lines
768 B
C
Raw Normal View History

2022-04-09 15:05:23 -04:00
#include <stdio.h> //printf and shit
#include <time.h>
int main( int argc, char *argv[] ) { //yoinked from the internet argc is number of args and argv is a "array of arguments"
clock_t prevtime, currenttime;
prevtime = clock();
int delay = 20000;
int gamerun = 1;
while(gamerun) {
currenttime = clock();
if ((currenttime - prevtime) > delay) {
puts("this should only print every second");
if ((currenttime - prevtime) > 100000) {
puts("this should happen every 2 seconds");
}
prevtime = currenttime;
}
}
printf("Args %d",argc); //anti Wall Werror Wextra
puts(argv[0]);//anti Wall Werror Wextra
return 0;
}