Timer is too fast

I need help with this code I've been working on, I am a beginner to c++ and using xcode for my programs. The countdown on this clock treats the hours like minutes, the minutes like second,ect. I am also unable to to use system("clear") and when i do it tells me "TERM environment variable not set". I am asking for help on what I have missed or just gotten completely wrong. Any pointers or suggestions would be greatly appreciated.

#include <iostream>
#include <stdio.h>
#include <time.h>
#include <curses.h>


using namespace std;
int main()
{
int m, s,h;
cout << "EGG TIMER YEAH " << endl;
cout<< "enter time in hours here"<< endl;
cin>> h;
cout << "enter time in minutes here" << endl;
cin >> m;
cout << "enter time in seconds here " << endl;
cin >> s;
cout << "Press any key to start" << endl;
cout << " EGG TIMER YEAH" << endl;
cout << "time remaining" << endl;
cout << "hours : " << "mins : " << m << " secs : " << s << endl;
for (int hour = h; hour >= 0; hour--)
{
for (int min = m; min >= 0 ; min--)
{
if ( min == 0 && h > 0)
m = 59;
for (int sec = s; sec >= 0; sec--)
{
if ( sec == 0 )
s = 59;
int sleep_for(std::chrono::duration < long long>);
system("clear");

cout << hour << "hours: " << min << " :minuts " << sec << " :seconds " << endl;
}

}
}
int sleep_for(std::chrono::duration < long long >);
cout << "THE END" << endl;
return 0;}
Topic archived. No new replies allowed.