#include <stdio.h>
void pauseSec(int);
main()
{
int k;
int i;
int waited;
int goalInput;
int j;
int elapsed;
printf("\nPlease enter the amount of seconds to wait: ");
scanf("%d", &goalInput);
i = time(NULL);
k = time(NULL) + goalInput;
while (time(NULL)<k)
{
pauseSec(1);
waited = time(NULL) - i;
printf("\nSeconds waited: %d\n", waited
);
printf("Time left: %d out of %d seconds.\n", goalInput - waited, goalInput
);
}
printf("\nTotal seconds of your life just wasted: %d\n", waited
);
}
//function defnitions:
void pauseSec(int seconds)
{
int elapsed;
int j;
j = time(NULL);
do{
elapsed = time(NULL);
}
while((elapsed-j)<seconds);
}