+ 3

Can we run a function for specific time in c++.

Is there something like this. Run(PlayCandyCrush(), 60); // Runs PlayCandyCrush() for 60 sec only PlayCandyCrush() has many getch() in it to take input

4th Dec 2017, 11:01 PM
Muneeb Zubair Khan
Muneeb Zubair Khan - avatar
2 Answers
0
You could add it as a function argument and implement something that would take the time and store it as an unsigned integer, then check to see if it was 60 more than before.
3rd Dec 2017, 2:24 PM
LunarCoffee
LunarCoffee - avatar