aditor 0.1.0

一个简单的时间计算工具库,支持时间加减和差值计算。
Documentation
  • Coverage
  • 60%
    3 out of 5 items documented0 out of 4 items with examples
  • Size
  • Source code size: 4.07 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.07 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • zch1234qq

aditor

一个简单的时间计算工具库,支持:

  • 时间加法:add_seconds(timestamp, seconds)
  • 时间减法:sub_seconds(timestamp, seconds)
  • 时间差值:diff_seconds(ts1, ts2)

安装

在你的 Cargo.toml 中添加:

[dependencies]

aditor = "0.1"

使用

use aditor::{add_seconds, sub_seconds, diff_seconds};

fn main() {
    let t = 1_000u64;
    let t2 = add_seconds(t, 60);
    assert_eq!(t2, 1_060);

    let t3 = sub_seconds(t, 60);
    assert_eq!(t3, 940);

    let d = diff_seconds(1_000, 800);
    assert_eq!(d, 200);
}

许可证

MIT OR Apache-2.0