title: Timed function call
body: <p>I am programming in C++, Linux environment. How could I call a function after a certain interval in asynchronous manner and also at regular interval? I found Boost timer at <a href="http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tuttimer2.html" rel="nofollow">http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/tutorial/tuttimer2.html</a>. However, it needs to call io.run() to invoke the callback, which in turns bring me back to the original problem of needing me to take care of the elapsed time to call the function. What I need is something like the C# System.Threading.Timer which would call back the function I passed after the time period specified.</p>
  
  <p>I am thinking of creating a thread for each function call. However, I have quite a large number of such timer callback. Hence, I am afraid it would be expensive to create such threads or do I have other options?</p>
  
  <p>Thanks.</p>