c delay

Solutions on MaxInterview for c delay by the best coders in the world

showing results for - "c delay"
Nova
28 Feb 2016
1/** really not much to say...
2   just a way to program a delay
3   between commands in your code. **/
4
5//C library statement
6#include <time.h>
7
8//Driver program
9void dealy(int numOfSec)
10{
11	/* the delay itself runs with milli seconds
12	   so here we multiply the seconds by 1000.  */
13	int numOfMilliSec = 1000 * numOfSec;
14	
15	/* Making the time pass with nothing running
16	   until the time is up.                     */
17	time_t startTime = clock();
18	while(clock() < startTime + numOfMilliSec);
19}
20
21/*To use the delay just use the command:
22  delay(x);
23  you need to replace x with the number
24  of seconds that you want the delay to
25  be.                                    */
26  
27///The code itself without the details:
28
29#include <time.h>
30
31void delay(int numOfSec)
32{
33	int numOfMilliSec = 1000 * numOfSec;
34	time_t startTime = clock();
35	while(clock() < startTime + numOfMilliSec);
36}
Michael
12 Sep 2020
1#include <stdio.h>
2#include <unistd.h> //you need this for linux!
3#include <dos.h> //you need this for Windows!
4
5int main(){
6    printf("Hello,");
7    sleep(5); // format is sleep(x); where x is # of seconds.
8    printf("World");
9    return 0;
10}
Marie
27 Oct 2020
1// for micro programming use(havnt tested in other projects):
2#include <delay.h>
queries leading to this page
how to create delay in ctime delay in cc wait for 1 seconddefault delay function of cc wait for secondsc delay function documentationdelay 28 29 in cdelay less than a second in cc include delaywait for one seconds in cdelay using cdelay in c is in seconds 3fc pause program for 1 seconddelay in c programminghow to write a delay function in chow to give delay in chow to have a c 23 timer wait 5 seconds before clearing the screenc wait secondshow to wait time in chow to use delay in ctime c delayhow to delay the program in c1 sec delay in cc delay functionc wait 1 secondc programming sleep 1 seconddelay function in cdelay en chow to delay time in c 27c wait one secondc wait 3 secondshow to make delay in csystem 28wait time 29 cinclude delay in cc 40 delaywait 1 second chow to creat delay in cc waitpidhow to delay a certain line in cdelay function in c not workingwhere is delay is located in cdelay in c programhow to make a c program wait for 1 secondhow to use delay function in cpause code for 1 second cc delay timefor delay in cc how to wait for a secondtime delay function in c linux c wait secondsc wait timefunction that waits time cc program delay functionhow to add delay in chow to delay a function in cc delay 1 secondtime h delaymake c wait 1 seconddelay 28 29 in c meanshow to use a delay cdelay 2 seconds cc pausehow to create a delay in cdelay c programhow to make delay in c codehow to delay in cc language delaywait x seconds cc how to use delayhow to delay in c 2b 2b cs50how to delay outputs in cdelay 282000 29 in cc pause for 1 secondhow to have delay in chow to wait one second then pause c 2b 2bdelay in chow to use delay in c programc built in delay functionhow to make a delay in csystem pause in chow to implement delay in cmake a program wait a certain amount of time cdelay code in cc programming pause for secondswait seconds csend a text using delay in cwait for 1 sec in cdelay function in chow to add delay in c programc programming delay functionhow to delay function in c c delaydelay cc delay