0
How to add a delay in Code Playground.
I want to insert an delay of x seconds and then print the next statement. Please list the header file and the pseudo code for usage. Thanks!
5 Answers
+ 5
You can't do that in C++ on the code playground. The way it works is that it compiles and executes the program on a remote server, and when it finishes (or after a time limit is reached), the output is sent to us.
But you can do that in javascript for example, since the code runs client-side.
+ 1
There is function called sleep() in dos.h. It will help
0
Use a loop.
0
use loop.... (not sure that it will work out not)
for(int I=0;I<35000;I++);
0
@Zen Thanks! I made a code 'Get your starter pokemon' and I wanted to print two statement and then a delay before printing the final statement which would declare which Pokémon the user got. But I guess I can't do anything about it. :( (At least not in C++)
@Rohit @Misha Thanks for your response too.