All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased - ReleaseDate
0.12.2 - 2023-12-31
- Fixed an issue with the monotonic clock for macOS/iOS where it would undermeasure time compared to
what would be measured by
std::time::Instant
due to using a clock source that did not account for device sleep. (#97)
0.12.1 - 2023-10-31
- Populate global recent time before
Upkeep
starts. (#95)
0.12.0 - 2023-10-04
- Experimental support for ARM. (#91)
- Update
raw-cpuid
to 11.0.
0.11.1 - 2023-05-28
- 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)
0.11.0 - 2023-03-24
Instant::elapsed()
has been added. (#82)
Instant::duration_since
andInstant::sub
now saturates to zero. (#82)- Performance of
Instant::now
under high contention has been improved. (#82)
0.10.1 - 2022-07-20
- Implement
std::error::Error
forquanta::Error
. (#68)
- Fixed build issue on x86/x86_64 platforms that did not have SSE.
- Fix scaling factor for
window.performance.now()
in WASM. (#72)
0.10.0 - 2022-05-18
- Documentation has been updated to reflect that
quanta
does 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.
Instant::as_u64
has 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::upkeep
has been removed. It doesn't need to exist onClock
directly, as we have had thequanta::set_recent
free function for a while now, and was just duplicating that.Clock::start
andClock::end
have 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.
- CI tests for MIPS/ARM. (#55)
- Fixed compilation issue with
Mock
on MIPS/ARM. (#55) - Simplified how TSC/RDTSC suppoort is detected, which should avoid some situations where it was assumed to be present, but actually was not. (#57)
- Pinned
crossbeam-utils
tov0.8.5
whereAtomicCell::fetch_update
was introduced to fix, which fixes broken builds where Cargo chooses a version between0.8.0
and0.8.5
. - Update
raw-cpuid
to10.2
andaverage
to0.13
.
- Switched from
atomic-shim
tocrossbeam-utils
for better cross-platform atomic support. (#52)
- Support for WASM/WASI targets. (#45)
Instant::as_unix_duration
as it was added in error.metrics
feature flag asmetrics-core
is no longer a relevant crate.
- Bumped dependency on
raw-cpuid
to9.0
in order to deal with a RustSec advisory.
- Incorrect method visibility for non-SSE2 implementation of
Counter
. (#38)
- MSRV bumped to 1.45.0.
Clock::now
takes&self
instead 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.
- New methods --
Instant::now
andInstant::recent
for getting the current and recent time, respectively. - New free function
quanta::with_clock
for setting an override on the current thread that affects calls made toInstant::now
andInstant::recent
. - New free function
quanta::set_recent
to allow customization of how global recent time is updated.
- Fixed a bug with not being able to start the upkeep thread at all. (#29)
- Add
Instant::as_unix_duration
to get the duration of time since the Unix epoch from anInstant
. - Remove
clocksource
from dependencies and tests as it no longer compiles on stable or nightly.
- Publicly expose
Clock::upkeep
for advanced use cases. - Relax constraints around checking for multiple sockets. (#25)
- Add support for MIPS/PowerPC. (#23)
- Publicly expose the
Error
type returned byUpkeep::start
.
This version of quanta
was 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.
Clock::now
now 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
Clock
instances, running only once when the firstClock
is created.
- Fix the logic to figure out when calibration is required. (#14)
- Small tweak to the docs.
- Switch to
mach
for macOS/iOS as it was deprecated inlibc
. (#12) - Switch to
core::arch
for instrinics, and drop the feature flagged configuration to use it. (#12) - Switch to
criterion
for benchmarking. (#12)
- Differentiate between raw and scaled time by adding a new
Instant
type. (#10)
- 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.
- Initial commit.