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:
@@ -10,7 +10,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
|
||||
void print(const boost::system::error_code& /*e*/)
|
||||
{
|
||||
@@ -21,7 +20,7 @@ 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.async_wait(&print);
|
||||
|
||||
io.run();
|
||||
|
||||
Reference in New Issue
Block a user