samedi 1 décembre 2018

Create a timer in C++ that allows me to use the time as a condition for an If and While loop

I have a project that has 4 functions, it calls each function after an if condition I set while in main function I have an while loop that adds 1 to an int each time it runs and then runs the other functions . However I want to make it time based, in a way that a timer is set and use a while function so when time is less than lets say 1 minute, it will run this while condition , after a certain amount of time it will exit the while condition and run 2 other functions at least once and then anotehr while condition that will run the last function in a loop.

However I haven o idea how to implement a timer in my main function so it will create a variable that I can use for my while condition. If someone can help me on how to create a timer and use it for an while, and if , it would be nice. Thanks

Aucun commentaire:

Enregistrer un commentaire