1. #include <stdio.h>
  2. void pauseSec(int);
  3.  
  4. main()
  5. {
  6. int k;
  7. int i;
  8. int waited;
  9. int goalInput;
  10. int j;
  11. int elapsed;
  12. printf("\nPlease enter the amount of seconds to wait: ");
  13. scanf("%d", &goalInput);
  14. i = time(NULL);
  15. k = time(NULL) + goalInput;
  16. while (time(NULL)<k)
  17. {
  18. pauseSec(1);
  19. waited = time(NULL) - i;
  20. printf("\nSeconds waited: %d\n", waited);
  21. printf("Time left: %d out of %d seconds.\n", goalInput - waited, goalInput);
  22.  
  23.  
  24.  
  25. }
  26. printf("\nTotal seconds of your life just wasted: %d\n", waited);
  27. }
  28.  
  29. //function defnitions:
  30. void pauseSec(int seconds)
  31. {
  32. int elapsed;
  33. int j;
  34. j = time(NULL);
  35. do{
  36. elapsed = time(NULL);
  37. }
  38. while((elapsed-j)<seconds);
  39. }