Skip to content
This repository was archived by the owner on Jun 6, 2026. It is now read-only.

Commit 1994420

Browse files
XmchxUptisonkun
andauthored
feat: impl time-wheel based timer (#30)
Signed-off-by: Xmchx <1394466835@qq.com> Co-authored-by: tison <wander4096@gmail.com>
1 parent 9765ec4 commit 1994420

7 files changed

Lines changed: 484 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
# limitations under the License.
1414

1515
[workspace]
16-
members = ["fastimer", "fastimer-core", "fastimer-tokio", "xtask"]
16+
members = [
17+
"fastimer",
18+
"fastimer-core",
19+
"fastimer-timewheel",
20+
"fastimer-tokio",
21+
"xtask",
22+
]
1723
resolver = "2"
1824

1925
[workspace.package]
@@ -30,9 +36,12 @@ fastimer-core = { version = "0.1.0", path = "fastimer-core" }
3036
fastimer-tokio = { version = "0.10.0", path = "fastimer-tokio" }
3137

3238
# Crates.io dependencies
39+
atomic-waker = { version = "1.1.2" }
3340
clap = { version = "4.5.20", features = ["derive"] }
41+
crossbeam-queue = { version = "0.3.12" }
3442
log = { version = "0.4.28" }
3543
logforth = { version = "0.28.1" }
44+
parking = { version = "2.2.1" }
3645
pin-project = { version = "1.1.10" }
3746
tokio = { version = "1.47.1" }
3847
which = { version = "8.0.0" }

fastimer-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## Overview
1414

15-
This crate provides core APIs.
15+
This crate provides core APIs for fastimer.
1616

1717
## Documentation
1818

fastimer-timewheel/Cargo.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2024 FastLabs Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
[package]
16+
name = "fastimer-timewheel"
17+
version = "0.1.0"
18+
19+
description = "Timewheel based implementation for fastimer"
20+
readme = "README.md"
21+
22+
edition.workspace = true
23+
homepage.workspace = true
24+
license.workspace = true
25+
repository.workspace = true
26+
rust-version.workspace = true
27+
28+
[dependencies]
29+
atomic-waker = { workspace = true }
30+
crossbeam-queue = { workspace = true }
31+
fastimer-core = { workspace = true }
32+
parking = { workspace = true }
33+
34+
[dev-dependencies]
35+
tokio = { workspace = true, features = ["full"] }
36+
37+
[lints]
38+
workspace = true

fastimer-timewheel/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Fastimer Timewheel Implementation
2+
3+
[![Crates.io][crates-badge]][crates-url]
4+
[![Documentation][docs-badge]][docs-url]
5+
[![MSRV 1.85][msrv-badge]](https://www.whatrustisit.com)
6+
7+
[crates-badge]: https://img.shields.io/crates/v/fastimer-timewheel.svg
8+
[crates-url]: https://crates.io/crates/fastimer-timewheel
9+
[docs-badge]: https://docs.rs/fastimer-timewheel/badge.svg
10+
[msrv-badge]: https://img.shields.io/badge/MSRV-1.85-green?logo=rust
11+
[docs-url]: https://docs.rs/fastimer-timewheel
12+
13+
## Overview
14+
15+
This crate provides timewheel based driver implementation.
16+
17+
## Documentation
18+
19+
Read the online documents at https://docs.rs/fastimer-timewheel.
20+
21+
## Minimum Supported Rust Version (MSRV)
22+
23+
This crate is built against the latest stable release, and its minimum supported rustc version is 1.85.0.
24+
25+
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.
26+
27+
## License
28+
29+
This project is licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).

0 commit comments

Comments
 (0)