I want to write a loop, and have it record the value of a variable at a specific interval, say, every minute without interfering with the loop. How can I do this? Is there something like setTimeout() in javascript, in C++?