#representation #fixed-size #duration #timer #times #repository #projects

clocksource

Library for times and durations with fixed-size representations

14 unstable releases (6 breaking)

0.8.1 Jan 23, 2024
0.8.0 Dec 15, 2023
0.7.1 Dec 15, 2023
0.7.0 Aug 24, 2023
0.2.0 Aug 27, 2016

#45 in Date and time

Download history 3266/week @ 2023-11-20 3172/week @ 2023-11-27 3048/week @ 2023-12-04 4487/week @ 2023-12-11 7260/week @ 2023-12-18 2579/week @ 2023-12-25 6362/week @ 2024-01-01 8410/week @ 2024-01-08 7895/week @ 2024-01-15 7225/week @ 2024-01-22 111100/week @ 2024-01-29 9226/week @ 2024-02-05 8218/week @ 2024-02-12 6009/week @ 2024-02-19 5231/week @ 2024-02-26 5949/week @ 2024-03-04

25,569 downloads per month
Used in 13 crates (7 directly)

MIT/Apache

82KB
1.5K SLoC

rustcommon

rustcommon is a collection of common libraries we use in our Rust projects. This includes datastructures, logging, metrics, timers, and ratelimiting.

Overview

rustcommon is a workspace repository which contains several crates (libraries) which act as foundational libraries for other Rust projects, such as Pelikan, rpc-perf, and Rezolus.

Each crate within this repository contains its own readme and changelog detailing the purpose and history of the library.

Getting Started

Building

rustcommon is built with the standard Rust toolchain which can be installed and managed via rustup or by following the directions on the Rust website.

Clone and build rustcommon from source

git clone https://github.com/pelikan-io/rustcommon
cd rustcommon

# run tests
cargo test --all

Support

Create a new issue on GitHub.

Authors

A full list of contributors can be found on GitHub.


lib.rs:

This crate provides time and duration types with fixed-size representations with either coarse or precise resolution. This allows for using these types in places where a known size is required.

The internal representations also trade decreased representable ranges in exchange for smaller types. This makes them appealing for short timescales when smaller sized types are beneficial, such as in item metadata.

Since the internal representations use a single 32bit or 64bit value, math operations on the types are cheaper than they are with the standard time types.

Dependencies

~0.7–1MB
~15K SLoC