+ 6
C++ Timers in sololearn
Hi all After I run this, loop counts to 3 and stops for time limit error also it prints all at once not in every 1000 milliseconds. I tried to use <chrono> and <thread> but it seems <thread> is not supported by sololearn. Quesestion is , How can I print values every 1000 millisecond (here) ? #include <Windows.h> #include <iostream> using namespace std ; int main() { for(int x = 0 ; x < 10; x++){ Sleep(1000); cout << x << endl; } }
2 Antworten
+ 8
no timers will work here the way you want to use them. everything is compiled on the server. we only see the final output. thus all inputs must be entered at runtime
+ 5
Thanks.