What would be the best way to run certain code (c++ cross-platform) at specific intervals :
for example :