quanta
high-speed timing library
0.12.6
138M downloads/mo
#660 most downloaded on crates.io
metrics-rs/quanta
What this package is like to depend on
Last release 1 years ago
10 Jun 2025
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 29 of 33 stable releases
2 versions withdrawn
withdrawn after publishing
8 years old
38 releases · first in 2019
0 releases in the last 12 months
see the full history below
Release timeline
38 releases · Jan 2019 to Jun 2025Releases
latest 38-
0.12.610 Jun 2025 -
0.12.501 Jan 2025Release notes
Open source →Fixed
- Fixed an issue with lossy truncation in checked arithemtic methods for
Instant. (#110)
- Fixed an issue with lossy truncation in checked arithemtic methods for
-
0.12.413 Dec 2024 -
0.12.331 Mar 2024Release notes
Open source →Changed
- Disabled counter support on iOS targets even if AArch64 is present. This is due to an issue where the necessary CPU instruction for reading the counter is not available on iOS.
-
0.12.231 Dec 2023Release notes
Open source →Fixed
- Fixed an issue with the monotonic clock for macOS/iOS where it would undermeasure time compared to
what would be measured by
std::time::Instantdue to using a clock source that did not account for device sleep. (#97)
- Fixed an issue with the monotonic clock for macOS/iOS where it would undermeasure time compared to
what would be measured by
-
0.12.131 Oct 2023 -
0.12.004 Oct 2023Release notes
Open source → -
0.11.128 May 2023Release notes
Open source →Added
- Added a new method,
Clock::delta_as_nanos, for getting the delta between two raw measurements as the whole number of nanoseconds instead of the initial conversion toDuration. (#86)
- Added a new method,
-
0.11.024 Mar 2023 -
0.10.120 Jul 2022Release notes
Open source →Added
- Implement
std::error::Errorforquanta::Error. (#68)
Changed
- Fixed build issue on x86/x86_64 platforms that did not have SSE.
- Fix scaling factor for
window.performance.now()in WASM. (#72)
- Implement
-
0.10.018 May 2022Release notes
Open source →Changed
- Documentation has been updated to reflect that
quantadoes not track time across system suspends. - Fixed a panic in the calibration loop if a certain edge case with TSC measurements is encountered.
- Updated a unit test that was frequently flaky to be more precise.
Removed
Instant::as_u64has been removed. As it provided direct access to an value that could fundamentally change from version-to-version, it felt like time to remove that footgun and push users more towards the API that mimicsstd::time.Clock::upkeephas been removed. It doesn't need to exist onClockdirectly, as we have had thequanta::set_recentfree function for a while now, and was just duplicating that.Clock::startandClock::endhave been removed. They saw limited usage and overall just added somewhat needless API clutter given that users who are looking to do ultra-precise timing will either want more control or use another technique such as instruction counting.
- Documentation has been updated to reflect that
-
0.9.316 Sep 2021 -
0.9.225 Aug 2021Release notes
Open source →Changed
- Pinned
crossbeam-utilstov0.8.5whereAtomicCell::fetch_updatewas introduced to fix, which fixes broken builds where Cargo chooses a version between0.8.0and0.8.5. - Update
raw-cpuidto10.2andaverageto0.13.
- Pinned
-
0.9.112 Aug 2021Release notes
Open source →Changed
- Switched from
atomic-shimtocrossbeam-utilsfor better cross-platform atomic support. (#52)
- Switched from
-
0.9.017 Jun 2021 -
0.8.007 Jun 2021Release notes
Open source →Removed
Instant::as_unix_durationas it was added in error.metricsfeature flag asmetrics-coreis no longer a relevant crate.
-
0.7.225 Jan 2021Release notes
Open source →Changed
- Bumped dependency on
raw-cpuidto9.0in order to deal with a RustSec advisory.
- Bumped dependency on
-
0.7.124 Jan 2021Release notes
Open source →Fixed
- Incorrect method visibility for non-SSE2 implementation of
Counter. (#38)
- Incorrect method visibility for non-SSE2 implementation of
-
0.7.003 Jan 2021Release notes
Open source →Changed
- MSRV bumped to 1.45.0.
Clock::nowtakes&selfinstead of&mut self.- Fixed a bug where a failure to spawn the upkeep thread would not allow subsequent attempts to spawn the upkeep thread to proceed.
Added
- New methods --
Instant::nowandInstant::recentfor getting the current and recent time, respectively. - New free function
quanta::with_clockfor setting an override on the current thread that affects calls made toInstant::nowandInstant::recent. - New free function
quanta::set_recentto allow customization of how global recent time is updated.
-
0.6.6-alpha.122 Sep 2020 pre-releaseNothing published for this version
-
0.6.516 Sep 2020Release notes
Open source →Changed
- Fixed a bug with not being able to start the upkeep thread at all. (#29)
-
0.6.427 Aug 2020Release notes
Open source →Added
- Add
Instant::as_unix_durationto get the duration of time since the Unix epoch from anInstant.Changed
- Remove
clocksourcefrom dependencies and tests as it no longer compiles on stable or nightly.
- Add
-
0.6.303 Aug 2020Release notes
Open source →Changed
- Publicly expose
Clock::upkeepfor advanced use cases. - Relax constraints around checking for multiple sockets. (#25)
- Publicly expose
-
0.6.221 Jul 2020 -
0.6.113 Jul 2020 -
0.6.006 Jul 2020Release notes
Open source →This version of
quantawas a massive overhaul of man areas of the API and internals, which was done in a single PR: (#19). You can read the PR description for the finer details. All changes below are part of the aforementioned PR.Changed
Clock::nownow returns a monotonic value in all cases.- No longer possible to get a negative value from
Clock::delta. - Calibration is no longer a fixed one second loop, and will complete when it detects it has a statistically viable calibration ratio, or when it exceeds 200ms of wall-clock time. In most cases, it should complete in under 10ms.
- Calibration is now shared amongst all
Clockinstances, running only once when the firstClockis created.
-
0.5.3-alpha.203 Jun 2020 pre-releaseNothing published for this version
-
0.5.3-alpha.126 May 2020 pre-releaseNothing published for this version
-
0.5.201 May 2020 -
0.5.112 Apr 2020 withdrawn -
0.5.012 Apr 2020 withdrawn -
0.4.125 Feb 2020Nothing published for this version
-
0.4.020 Feb 2020Release notes
Open source →Changed
- Differentiate between raw and scaled time by adding a new
Instanttype. (#10)
- Differentiate between raw and scaled time by adding a new
-
0.3.221 Jul 2020Nothing published for this version
-
0.3.102 Jun 2019Nothing published for this version
-
0.3.027 May 2019Nothing published for this version
-
0.2.010 Mar 2019Release notes
Open source →Changed
- Fixed support for Windows. It was in a bad way, but actually works correctly now!
- Switched to Azure Pipelines CI + Cirrus CI, including formatting, tests, and benchmarks, for Linux, macOS, Windows, and FreeBSD.
-
0.1.014 Jan 2019Release notes
Open source →Added
- Initial commit.
<!-- next-url --> [Unreleased]: https://github.com/metrics-rs/quanta/compare/v0.12.6...HEAD [0.12.6]: https://github.com/metrics-rs/quanta/compare/v0.12.5...v0.12.6 [0.12.5]: https://github.com/metrics-rs/quanta/compare/v0.12.4...v0.12.5 [0.12.4]: https://github.com/metrics-rs/quanta/compare/v0.12.3...v0.12.4 [0.12.3]: https://github.com/metrics-rs/quanta/compare/v0.12.2...v0.12.3 [0.12.2]: https://github.com/metrics-rs/quanta/compare/v0.12.1...v0.12.2 [0.12.1]: https://github.com/metrics-rs/quanta/compare/v0.12.0...v0.12.1 [0.12.0]: https://github.com/metrics-rs/quanta/compare/v0.11.1...v0.12.0 [0.11.1]: https://github.com/metrics-rs/quanta/compare/v0.11.0...v0.11.1 [0.11.0]: https://github.com/metrics-rs/quanta/compare/v0.10.1...v0.11.0 [0.10.1]: https://github.com/metrics-rs/quanta/compare/v0.10.0...v0.10.1 [0.10.0]: https://github.com/metrics-rs/quanta/releases/tag/v0.10.0