Hej!
I am looking for a portable way of periodically dispatching a task in a C++ project. The use of libraries such as boost should be avoided in this particular project.
The resolution requirement is not too serious: between 5Hz to 20Hz on an average Netbook.
The project uses OpenGL to render the HMI but since I am working on the backend part I am not too familiar with it.
Thanks your any advice or suggestions,
Arne
EDIT: What our ‘Task’ class actually does is creating a thread using either CreateThread(..) for windows or pthread_create(..) for linux.
As most straightforward way to achieve this is to use Sleep(100ms) in a cycle, all you need is a portable Sleep. For Linux it can be implemented as follows