C Programming Tips & Tricks





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Code Snippets
 List All
 Arrays
 Calculators
 Datatypes
 Date & Time
 File Manipulation
 Math Functions
 Multimedia
 Others
 




Time Delay of 5 Seconds - C

Snippets  C  Time Delay of 5 Seconds
Snippet On
Time Delay




Code
  
Rate this page :
  [ 0 votes]

This program creates a time delay of 5 seconds.It is useful for games and online test.

#include <stdio.h>
#include <time.h>

int main()
{
time_t start;
time_t current;
time(&start);

printf("delay for 5 seconds.\n");
do{
time(¤t);
}while(difftime(current,start) < 5.0);
printf("Finished delay.\n");
return 0;
}




Other Links

web hosting