-1

I'm using Visual Studio 10/13 with c, and I want to wait a few seconds between two printf statements:

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

int a,b;
do
{
    printf("%d\n", a);
    //wait 1 sec
    system("cls");
    printf("%d\n", b);
}while(1)

When it's ready, it should generate the framerate of a little game. For example, waiting 0.5 sec gives about 2 frames per sec.

chux - Reinstate Monica
  • 143,097
  • 13
  • 135
  • 256
thefighter3
  • 69
  • 1
  • 3
  • 13

1 Answers1

1

Can use

    Sleep(1000);

Header-windows.h

udit043
  • 1,610
  • 3
  • 22
  • 40