#action #interval #scheduled #timer #traits #delay #utilities

fastimer

This crates implements runtime-agnostic timer traits and utilities

13 releases (6 breaking)

0.7.0 Feb 10, 2025
0.6.0 Feb 5, 2025
0.5.0 Feb 1, 2025
0.4.1 Jan 15, 2025
0.1.1 Dec 11, 2024

#834 in Asynchronous

Download history 610/week @ 2024-12-06 216/week @ 2024-12-13 268/week @ 2024-12-20 117/week @ 2024-12-27 126/week @ 2025-01-03 168/week @ 2025-01-10 63/week @ 2025-01-17 12/week @ 2025-01-24 288/week @ 2025-01-31 189/week @ 2025-02-07 29/week @ 2025-02-14

509 downloads per month
Used in 2 crates

Apache-2.0

40KB
524 lines

Fastimer

Crates.io Documentation MSRV 1.83 Apache 2.0 licensed Build Status

Overview

Fastimer implements runtime-agnostic timer traits and utilities.

Scheduled Actions

Fastimer provides scheduled actions that can be scheduled as a repeating and cancellable action.

  • SimpleAction: A simple repeatable action that can be scheduled with a fixed delay, or at a fixed rate.
  • ArbitraryDelayAction: A repeatable action that can be scheduled with arbitrary delay.
  • NotifyAction: A repeatable action that can be scheduled by notifications.

Timeout

  • Timeout is a future combinator that completes when the inner future completes or when the timeout expires.

Interval

  • Interval ticks at a sequence of instants with a certain duration between each instant.

Installation

Add the dependency to your Cargo.toml via:

cargo add fastimer

Documentation

Read the online documents at https://docs.rs/fastimer.

Minimum Supported Rust Version (MSRV)

This crate is built against the latest stable release, and its minimum supported rustc version is 1.80.0.

The policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if Fastimer 1.0 requires Rust 1.20.0, then Fastimer 1.0.z for all values of z will also require Rust 1.20.0 or newer. However, Fastimer 1.y for y > 0 may require a newer minimum version of Rust.

License

This project is licensed under Apache License, Version 2.0.

Dependencies

~235–700KB
~15K SLoC