Tokio timer APIs


I found 2 different Timer APIs:

  • tokio_timer::Timer
  • tokio_core::reactor::{Timeout, Interval}

Which one is recommended?
Thank you,

1 Like

The major difference is the tokio_timer doesn’t use the reactor, whereas the tokio_core::reactor does. The former can be used “standalone”, and the latter needs a tokio Core (ie reactor/event loop). IIRC the former also spawns a thread to handle the timeout; the latter uses the reactor to drive the timer.