Get unix time (nanoseconds) in blazing low latency with high precision

Related tags

Date and time rtsc
Overview

RTSC

Get unix time (nanoseconds) in blazing low latency with high precision. About 5xx faster than SystemTime::now().

Performance

OS CPU benchmark rtsc::unix_nano() rtsc::unix_nano_std()
macOS Monterey Intel Core i7-7700HQ bench & bench_std 7 ns/iter (+/- 1) 32 ns/iter (+/- 2)

Usage

  1. rtsc::init() for init env and functions. It'll find out tsc clock is reliable or not. Not thread safe.
  2. rtsc::unix_nano() for get timestamp.
  3. rtsc::calibrate() for calibrate the clock. Invoke it every 5 min is a good idea in background.

Details

You could find a Go version written me which explains how it works.

You might also like...
High precision decimal

decimal-rs High precision decimal with maximum precision of 38. Optional features serde When this optional dependency is enabled, Decimal implements t

Extremely low-latency chain data to Stackers, with a dose of mild humour on the side
Extremely low-latency chain data to Stackers, with a dose of mild humour on the side

Ronin Hello there! Ronin is a ultra-speed Stacks API server. It's super lightweight, but scales easily. Why are we making this? Because we don't like

Extreme Bevy is what you end up with by following my tutorial series on how to make a low-latency p2p web game.

Extreme Bevy Extreme Bevy is what you end up with by following my tutorial series on how to make a low-latency p2p web game. There game can be played

 Serenade: Low-Latency Session-Based Recommendations
Serenade: Low-Latency Session-Based Recommendations

Serenade: Low-Latency Session-Based Recommendations This repository contains the official code for session-based recommender system Serenade, which em

A vertically scalable stream processing framework focusing on low latency, helping you scale and consume financial data feeds.

DragonflyBot A vertically scalable stream processing framework focusing on low latency, helping you scale and consume financial data feeds. Design The

⚡️Blazing Fast⚡️ CLI tool to get Bible verses with Rust 🦀

bible.rs This is a simple command line tool that accesses bible-api.com to print Bible verses in the terminal Installation brew install wzid/tap/bible

A low-level assembly language for the Ethereum Virtual Machine built in blazing-fast pure rust.
A low-level assembly language for the Ethereum Virtual Machine built in blazing-fast pure rust.

huff-rs • huff-rs is a Huff compiler built in rust. What is a Huff? Huff is a low-level programming language designed for developing highly optimized

Sub-pixel precision light spot rendering library for astronomy and video tracking applications.

Planetarium Sub-pixel precision light spot rendering library for astronomy and video tracking applications. Example usage use planetarium::{Canvas, Sp

Extended precision integer Rust library. Provides signed/unsigned integer 256 to 2048.

Extended precision integer Rust library. Provides signed/unsigned integer 256 to 2048.

💣 SMH – a computer vision project for automatic, precision mortar strike calculations in Squad
💣 SMH – a computer vision project for automatic, precision mortar strike calculations in Squad

💣 Squad Mortar Helper (SMH) SMH is a computer vision toy project aimed at automating mortar calculations in the game Squad Download demo.mp4 Requirem

Multiple precision floating point numbers implemented purely in Rust.

Multiple precision floating point numbers implemented purely in Rust. Rationale There are several notable implementations of numbers with increased pr

Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes!
Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes!

Excavation Site Alpha Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes! Drag blocks off the conveyor b

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

The rust client for CeresDB. CeresDB is a high-performance, distributed, schema-less, cloud native time-series database that can handle both time-series and analytics workloads.

A unix "time" like benchmarking tool on steroids

benchie Usage Binary Once Rust is installed (see step 1 in "Toolchain Setup"), you can easily install the latest version of benchie with: $ cargo inst

Minimal and blazing-fast file server. For real, this time.

Zy Minimal and blazing-fast file server. For real, this time. Features Single Page Application support Partial responses (Range support) Cross-Origin

Untrusted IPC with maximum performance and minimum latency. On Rust, on Linux.

Untrusted IPC with maximum performance and minimum latency. On Rust, on Linux. When is this Rust crate useful? Performance or latency is crucial, and

A network bandwidth and latency tester.
A network bandwidth and latency tester.

Crusader Network Tester Setup Run cargo build --release to build the executables which are placed in target/release. Command line usage To host a serv

ShakeFlow: Functional Hardware Description with Latency-Insensitive Interface Combinators

ShakeFlow: Functional Hardware Description with Latency-Insensitive Interface Combinators This repository contains the artifact for the following pape

Owner
Ⅲx
I code slow, but codes run fast
Ⅲx
This crate provides high-performance formatting and parsing routines for ISO8061 timestamps

ISO8061 Timestamp This crate provides high-performance formatting and parsing routines for ISO8061 timestamps, primarily focused on UTC values but wit

Lantern 4 Sep 21, 2022
Date and time library for Rust

Chrono: Date and Time for Rust It aims to be a feature-complete superset of the time library. In particular, Chrono strictly adheres to ISO 8601. Chro

Chronotope 2.5k Jan 8, 2023
A set of tools for generating signed exchanges at serve time.

sxg-rs sxg-rs is a set of tools for generating signed exchanges at serve time: cloudflare_worker runs on Cloudflare Workers. fastly_compute runs on Fa

Google 64 Dec 26, 2022
rsdate connects to an ntp server, printing the returned time and/or sets the system clock.

?? ?? rsdate rsdate connects to an ntp server, printing the returned time and/or sets the system clock.

Wesley Moore 3 Dec 31, 2022
Time series anomaly detection for Rust

AnomalyDetection.rs Time series AnomalyDetection for Rust Learn how it works Installation Add this line to your application’s Cargo.toml under [depend

Andrew Kane 6 Nov 21, 2022
datez: convert a time into several timezones

datez: convert a time into several timezones In July, when it is 16:00 in Canberra, what time is it in Caracas, and where I am in Cambridge? $ datez 2

Tony Finch 7 Nov 17, 2021
Generate perfect code headers every time.

Generate perfect code headers every time.

t11s 111 Dec 28, 2022
A simple and fun way to view the time!

Concentric Time A simple and fun way to view the time! Screenshots Dark mode Light mode Dev This project uses Dioxus (a Rust-Wasm framework) and does

Parker McMullin 9 Oct 23, 2022
Date and time library for Rust. Feature rich, lightweight and easy-to-use.

Astrolabe Date and time library for Rust. Feature rich, lightweight and easy-to-use. Documentation | Github | Crate Example Status Astrolabe is curren

Jasmin 2 Sep 2, 2022
A secure, real-time, low-latency binary WebSocket RPC subprotocol.

HardLight A secure, real-time, low-latency binary WebSocket RPC subprotocol. HardLight has two data models: RPC: a client connects to a server, and ca

valera 5 Apr 2, 2023