I need working timer that don't interrupt anything else (so no sleep();)
I found few in google, even few here, on forums, but well, some doesn't work at all and this one, the easiest one imo:
When you say "doesn't interrupt", do you mean "won't pause other processing"?
Boost.Asio has an asynchronous timer and includes code on how to use it in their examples.
alarm(2) is another asynchronous method, but it's use is rather limited.
The simplest is to create a thread that sleeps and sets a flag that can be queried when it wakes up. Boost.Thread makes that a rather trivial exercise.
If you really need polling, then you've got the simplest implementation.