All Projects → metrics-rs → Quanta

metrics-rs / Quanta

Licence: mit
high-speed timing library in Rust

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Quanta

ngx http hmac secure link module
HMAC Secure Link module for NGINX.
Stars: ✭ 47 (-54.81%)
Mutual labels:  timestamp
secrets.clj
A library designed to generate cryptographically strong random numbers.
Stars: ✭ 64 (-38.46%)
Mutual labels:  timestamp
Tinydate
A tiny (349B) reusable date formatter. Extremely fast!
Stars: ✭ 990 (+851.92%)
Mutual labels:  timestamp
clockkit
Sub-msec accurate distributed timestamps.
Stars: ✭ 47 (-54.81%)
Mutual labels:  timestamp
viewts
Display PCR, DTS, PTS, bitrate, jitter of a mpeg TS.
Stars: ✭ 46 (-55.77%)
Mutual labels:  timestamp
Timestamp
⏰ A better macOS menu bar clock.
Stars: ✭ 296 (+184.62%)
Mutual labels:  timestamp
format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (-75.96%)
Mutual labels:  timestamp
Hls Trimming Frame Accuracy
JS Code that given a group of HLS chunks, a start timestamp, and end timestamp it creates one MP4 that contains the original V/A frame accuracy trimmed and perfectly aligned
Stars: ✭ 46 (-55.77%)
Mutual labels:  timestamp
Stamp-Craft
Plugin for adding timestamp to filenames.
Stars: ✭ 28 (-73.08%)
Mutual labels:  timestamp
Pki.js
PKI.js is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins.
Stars: ✭ 960 (+823.08%)
Mutual labels:  timestamp
timestampy
🕒 Bunch of utilities useful when working with UNIX timestamps
Stars: ✭ 21 (-79.81%)
Mutual labels:  timestamp
Get-NetworkConnection
Edited version of Lee Christensen's Get-NetworkConnection which includes timestamp for each network connection
Stars: ✭ 34 (-67.31%)
Mutual labels:  timestamp
Flask Moment
Formatting of dates and times in Flask templates using moment.js.
Stars: ✭ 321 (+208.65%)
Mutual labels:  timestamp
django-paranoid-model
Django abstract model with paranoid behavior
Stars: ✭ 17 (-83.65%)
Mutual labels:  timestamp
Fliplog
fluent logging with verbose insight, colors, tables, emoji, filtering, spinners, progress bars, timestamps, capturing, stack traces, tracking, presets, & more...
Stars: ✭ 41 (-60.58%)
Mutual labels:  timestamp
timestamp
Time-Stamp Protocol (TSP) implementation for Go as specified in RFC3161
Stars: ✭ 51 (-50.96%)
Mutual labels:  timestamp
node-red-contrib-sun-position
This is a ultimate Node-Red Timer, Sun, Moon and Blind flow control.
Stars: ✭ 59 (-43.27%)
Mutual labels:  timestamp
Snow Stamp
Get the timestamp from a Discord snowflake ❄
Stars: ✭ 95 (-8.65%)
Mutual labels:  timestamp
Pg variables
Session wide variables for PostgreSQL
Stars: ✭ 44 (-57.69%)
Mutual labels:  timestamp
Hashapi Lib Node
Tierion Hash API client library for Node.js
Stars: ✭ 20 (-80.77%)
Mutual labels:  timestamp

quanta

conduct-badge gh-actions-badge downloads-badge release-badge docs-badge libraries-io-badge license-badge

quanta is a high-speed timing library, useful for getting the current time very quickly, as well as manipulating it.

code of conduct

NOTE: All conversations and contributions to this project shall adhere to the Code of Conduct.

usage

The API documentation of this library can be found at docs.rs/quanta.

general features

  • count CPU cycles via Time Stamp Counter (TSC). or
  • get monotonic time, in nanoseconds, based on TSC (or OS fallback)
  • extremely low overhead where possible
  • mockable
  • cross-platform
  • fun, science-y name!

platform / architecture support

For platforms, we have tier 1 support for Linux, Windows, and macOS/iOS. Platforms such as Solaris or various BSDs have tier 2.5 support: quanta should work on them by virtue of depending on libc, but we don't test or build on these platforms as all.

Both x86/x86-64 and SSE2 support are checked for at compile-time, so compiler flags must be set correctly. Further checks will happen at runtime to assert that the TSC source itself is stable enough for taking measurements, and if so, will be utilized.

performance

quanta sits neck-and-neck with native OS time facilities: the cost of Clock::now is on par Instant::now from the stdlib, if not better.

why use this over stdlib?

Beyond having a performance edge in specific situations, the ability to use mocked time makes it easier to actually test that your application is doing the right thing when time is involved.

Additionally, and as mentioned in the general features section, quanta provides a safe/thin wrapper over accessing the Time Stamp Counter, which allows measuring cycle counts over short sections of code. This can be relevant/important for accurately measuring performance-critical sections of code.

alternative crates

  • chrono:
    • based on std::time::SystemTime: non-monotonic reads
    • focused on timezone-based "date/time" measurements, not intervals/elapsed time
    • clock cannot be altered at all (no pause, no discrete updates)
  • time:
    • based on std::time::SystemTime and std::time::Instant:
      • time::Time/time::PrimitiveDateTime use SystemTime: non-monotonic reads
      • time::Instant uses Instant: monotonic reads
    • focused on timezone-based "date/time" measurements, not interval/elapsed time
    • clock cannot be altered at all (no pause, no discrete updates)
  • clock:
    • based on std::time::SystemTime: non-monotonic reads
    • clock can be swapped (trait-based)
    • no free function for acquiring time
  • clocksource:
    • based on TSC w/ OS fallback; non-monotonic reads
    • clock cannot be altered at all (no pause, no discrete updates)
    • depends on unstable asm! macro + feature flag to enable TSC
    • no free function for acquiring time
  • pausable_clock:
    • based on std::time::Instant: monotonic reads
    • clock can be paused (time can be delayed, but not discretely updated)
    • no free function for acquiring time

license

quanta is licensed under the MIT license. (LICENSE or http://opensource.org/licenses/MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].