Skip to main content

Module timer

Module timer 

Source
Expand description

Countdown timer component.

This module provides a countdown timer that ticks down from a specified duration and sends timeout messages when complete.

§Example

use bubbles::timer::Timer;
use std::time::Duration;

let timer = Timer::new(Duration::from_secs(60));
assert_eq!(timer.remaining(), Duration::from_secs(60));
assert!(!timer.timed_out());

Structs§

StartStopMsg
Message to start or stop the timer.
TickMsg
Message sent on every timer tick.
TimeoutMsg
Message sent once when the timer times out.
Timer
Countdown timer model.