asio同步定时器:
#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
using namespace std;
using namespace boost;
int main()
{
asio::io_service io; //所有asio程序必须要有一个io_server对象
asio::deadline_timer t(io,posix_time::seconds(2)); //定时器,io_server作为构造函数的参数,2s后定时器终止
cout<<t.expires_at() << endl; //查看终止的绝对时间
t.wait(); //