You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
v2.0.0 - 2026-05-11
Added
Added Result::value() and Result::unit() to access the raw calculated value and current unit separately from formatted output.
Added Result::toArray() for structured result output with raw time, unit, and optional formatted values.
Changed
Changed Result::format() from positional placeholders like %s %s / %s%s to named placeholders like {time} and {unit} for clearer, more extensible formatting templates.
Updated Result to keep the raw calculated value separate from the selected format template. Result::get() still returns the rendered string when a format is set, while the raw value remains available through Result::value().
Changed TimeTracker::watch() to return the callback result in result and the execution time as a Result instance in time.
Fixed
Fixed formatted TimeTracker::durations() output by preserving the immutable Result returned from Result::format().
Updated callback error formatting in TimeTracker::watch() to use the named {time} and {unit} placeholders.
Breaking Changes
Existing format templates that use %s placeholders must be updated to use {time} and {unit} instead.
The Result constructor now expects the calculated value to be raw float|int|null; formatted strings should be produced through Result::format().
TimeTracker::watch() no longer returns separate unit and output keys. Use time for the Result instance and result for the callback return value.