Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs

Timer cpp


I need to run a timer while the program is la running something else. When the timer stops, the program will stop as well

My code is showing errors.
int random() {
using namespace std;
int answer;
cout << iSecret;
chrono::steady_clock::time_point tend=chrono::steady_clock::now() + chrono::seconds(10);
while (tend < 10) {
cin >> answer;
if (answer == tend) {
money = money + 10;
} else {
money = money - 10;
cout << "you have ";
cout << money;
cout << "cash";

4 years ago
You are viewing a single comment. View All