Skip to content
Snippets Groups Projects
Commit 2868047c authored by T.Wadi's avatar T.Wadi
Browse files

Delay function implimented

parent 3b0f7065
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,9 @@
int main()
{
PrintLogo
PrintLogo();
delay(2);
clearScreen();
return 0;
}
test.exe 0 → 100644
File added
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "tools.h"
/**********************************************************/
......@@ -66,4 +67,16 @@ void PrintLogo ()
}
/**********************************************************/
/**********************************************************/
\ No newline at end of file
/**********************************************************/
void delay(unsigned int number_of_seconds)
{
// Converting time into milli_seconds
int milli_seconds = 1000 * number_of_seconds;
// Storing start time
clock_t start_time = clock();
// looping till required time is not achieved
while (clock() < start_time + milli_seconds)
;
}
\ No newline at end of file
......@@ -5,5 +5,6 @@ void clearBuffer();
void waitForEnter();
int askYesOrNo(char*);
void PrintLogo ();
void delay(unsigned int number_of_seconds);
#endif // TOOLS_H_INCLUDED
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment