Boost库-asio

#define BOOST_ASIO_DISABLE_STD_CHRONO

#include 
#include 
#include 
#include 
#include "print.hpp"

int main(int argc, char** argv)
{
	mwsy::mwsy_print_start_and_end("mainStart");
	
	
	//同步处理时间计时器
	mwsy::mwsy_print_start_and_end("同步处理-定时-Start");
	boost::asio::io_service io;
	//设置过期时间
	boost::asio::steady_timer st0(io,boost::chrono::milliseconds(5000));
	//
	//std::cout << "st.expires_at():" << st0.expires_at() << std::endl; //纳秒长度
	//std::cout << "st.expires_from_now():" << st0.expires_from_now() << std::endl;
	st0.wait();
	//
	std::cout << "st.Wait()-End" << std::endl;
	mwsy::mwsy_print_start_and_end("同步处理-定时-End");

	mwsy::mwsy_print_start_and_end("mainEnd");

	return 0;
}

 

#ifndef mwsy_print_hpp
#define mwsy_print_hpp
#include 
#include 
namespace mwsy
{
	void mwsy_print_start_and_end(std::string str)
	{
		//
		std::cout <<"***********" << str << "**********"<

 

你可能感兴趣的:(boost之莫忘输赢)