This project is an implementation of the famous wheel timer. I will not explain how it is working as it is already documented on google.
See here for more details.
See the wiki page for details.
rpachon/wheel-timer-cpp
A simple implementation of a wheel Timer in order to manage timeout in c++
C++