15 Timers [timer]

15.4 Class template basic_waitable_timer [timer.waitable]

15.4.1 basic_waitable_timer constructors [timer.waitable.cons]

explicit basic_waitable_timer(io_context& ctx);

Effects: Equivalent to basic_waitable_timer(ctx, time_point()).

basic_waitable_timer(io_context& ctx, const time_point& t);


  • get_executor() == ctx.get_executor().

  • expiry() == t.

basic_waitable_timer(io_context& ctx, const duration& d);

Effects: Sets the expiry time as if by calling expires_after(d).

Postconditions: get_executor() == ctx.get_executor().

basic_waitable_timer(basic_waitable_timer&& rhs);

Effects: Move constructs an object of class basic_waitable_timer<Clock, WaitTraits> that refers to the state originally represented by rhs.


  • get_executor() == rhs.get_executor().

  • expiry() returns the same value as rhs.expiry() prior to the constructor invocation.

  • rhs.expiry() == time_point().