2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-21 16:52:09 +00:00

Update examples to use chrono rather than Boost.Date_Time.

N.B. The Windows-specific tick_count_timer example has been removed as
it has been superseded by timers based on the standard steady_clock.
It's also not clear how to map a wrapping time source to the standard
chrono concepts.
This commit is contained in:
Christopher Kohlhoff
2018-04-01 09:58:45 +10:00
parent 5672713c90
commit 69d54db71f
15 changed files with 111 additions and 244 deletions

View File

@@ -10,13 +10,12 @@
#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
int main()
{
boost::asio::io_context io;
boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
boost::asio::steady_timer t(io, boost::asio::chrono::seconds(5));
t.wait();
std::cout << "Hello, world!" << std::endl;