pub struct Timer(/* private fields */);Implementations§
Source§impl Timer
impl Timer
Sourcepub fn new<F>(
clk: Clock,
duration: Duration,
f: F,
name: String,
) -> AnyResult<Self>
pub fn new<F>( clk: Clock, duration: Duration, f: F, name: String, ) -> AnyResult<Self>
Creates a new Timer instance on the specified Clock.
§Arguments
clk: The clock instance which the timer is being created on.duration: Specifies the expiration duration of the timer.f: Callback function invoked after the timer expires.name: Name of the timer, used for logging purposes.
§Returns
Returns Ok(Timer) if successful, or an error if creation fails.