Skip to content

Instantly share code, notes, and snippets.

@AungWinnHtut
Last active March 4, 2018 14:49
Show Gist options
  • Save AungWinnHtut/c5f2bb0c001c84046b1d8738219a3af3 to your computer and use it in GitHub Desktop.
Save AungWinnHtut/c5f2bb0c001c84046b1d8738219a3af3 to your computer and use it in GitHub Desktop.
//These functios will help you when you need old delay() and clrscr() functions from Turbo C
//Anyone can use this code freely
//The original coder of delay function is https://stackoverflow.com/users/5148111/rizwan-raza
//I found at https://stackoverflow.com/questions/27447195/how-to-use-delay-function-in-c-using-codeblocks-13-12mingw
//Modified and matained by Green Hackers
//We will add more code here
#include<process.h>
#include<time.h>
void delay(unsigned int miliS)
{
clock_t targetTime = miliS + clock();
while (targetTime > clock());
}
void clrscr()
{
system("cls");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment