How to load a loop every 10 second and add +1 to the count and print it?
like:
int count;
while(true)
{
count +=1;
cout << count << endl; // print every 10 second
}
print:
1
2
3
4
5
ect...
i dont know how, please help me out guys
My try. (Almost) perfectly POSIX. Works on both POSIX and MSVC/Win32 also.
This way you can also have the control on each iteration, unlike the sleep()-based approach.
This solution (or the same based on high-precision timer) also ensures that there is no error accumulation in timing.
EDIT: OSX stuff, if all else fails