I've got the similar problem as python - loop at exact time intervals - the only difference is that I want to use C++.
So: how is it possible in C++ to make a loop in which every iteration would take a set amount of time, independently of the time of executing code in a loop?
// Example:
for (int i = 0; i < 100; i++)
{
cout << "foo" << endl; // prints foo every, let's say, 1s
bar(); // may take, let's say 1ms or 325ms (of course less than 1s)
}