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,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;
|
||||
|
||||
Reference in New Issue
Block a user