Develop a stopwatch with lap counter and total time calculator. The program will create two processes and they will start calculating time. One process will be used to calculate total time and the other will calculate lap time. The total time calculator process will keep on calculating time. In the lap time, calculator process when it reaches lap time limit, the process will display lap number and set its counter to zero and start calculating again. Take input of lap time and number of laps from the user and start the program. At the end, display total time from total time calculator process.
int main()
{
int sec=0;
int min=0;
int hour=0;
for (int i = 0; i < 99999999; i++)
{
sec++;
cout << hour << ":" << min << ":" << sec << endl;
if(sec == 60)
{
min++;
sec = 0;
}
else if(min == 60)
{
hour++;
min = 0;
}
Sleep(1000);
system("cls");
}
}
Comments
Leave a comment