phpunit/php-timer
Utility class for timing
9.0.0
948M downloads/mo
#52 most downloaded on composer
sebastianbergmann/php-timer
What this package is like to depend on
Last release 6 months ago
06 Feb 2026
Release timing varies
gaps range from 3 weeks to 2.2 years
Most releases are documented
notes for 20 of 29 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
29 releases · first in 2012
1 release in the last 12 months
see the full history below
Release timeline
29 releases · Sep 2012 to Feb 2026Releases
latest 29-
9.0.006 Feb 2026 -
8.0.007 Feb 2025 -
7.0.103 Jul 2024Release notes
Open source →Changed
- This project now uses PHPStan instead of Psalm for static analysis
Release notes
Open source →Changed
- This project now uses PHPStan instead of Psalm for static analysis
-
7.0.002 Feb 2024 -
6.0.003 Feb 2023Release notes
Open source →Removed
- This component is no longer supported on PHP 7.3, PHP 7.4 and PHP 8.0
-
5.0.326 Oct 2020Release notes
Open source →Fixed
SebastianBergmann\Timer\Exceptionnow correctly extends\Throwable
-
5.0.228 Sep 2020Release notes
Open source →Changed
- Changed PHP version constraint in
composer.jsonfrom^7.3 || ^8.0to>=7.3
- Changed PHP version constraint in
-
5.0.126 Jun 2020 -
5.0.007 Jun 2020Release notes
Open source →Changed
- Parameter type for
SebastianBergmann\Timer\Duration::fromMicroseconds()was changed frominttofloat - Parameter type for
SebastianBergmann\Timer\Duration::fromNanoseconds()was changed frominttofloat - Return type for
SebastianBergmann\Timer\Duration::asNanoseconds()was changed frominttofloat
Fixed
- #31: Type Error on 32-bit systems (where
hrtime()returnsfloatinstead ofint)
- Parameter type for
-
4.0.001 Jun 2020Release notes
Open source →Added
- Introduced
Durationvalue object for encapsulating a duration with nanosecond granularity - Introduced
ResourceUsageFormatterobject for formatting resource usage with option to explicitly pass a duration (instead of looking at the unreliable$_SERVER['REQUEST_TIME_FLOAT']variable)
Changed
- The methods of
Timerare no longer static Timer::stop()now returns aDurationvalue object
Removed
- Functionality that is now implemented in
DurationandResourceUsageFormatterhas been removed fromTimer
- Introduced
-
3.1.420 Apr 2020Release notes
Open source →Changed
Timer::timeSinceStartOfRequest()no longer tries$_SERVER['REQUEST_TIME']when$_SERVER['REQUEST_TIME_FLOAT']is not available ($_SERVER['REQUEST_TIME_FLOAT']was added in PHP 5.4 and this library requires PHP 7.3)- Improved exception messages when
$_SERVER['REQUEST_TIME_FLOAT']is not set or is not of typefloat
Changed
-
3.1.320 Apr 2020Release notes
Open source →Changed
Timer::timeSinceStartOfRequest()now raises an exception if$_SERVER['REQUEST_TIME_FLOAT']does not contain afloat(or$_SERVER['REQUEST_TIME']does not contain anint)
-
3.1.217 Apr 2020 -
3.1.117 Apr 2020Release notes
Open source →Fixed
- #30: Resolution of time returned by
Timer::stop()is different than before (this reverts usinghrtime()instead ofmicrotime())
- #30: Resolution of time returned by
-
3.1.017 Apr 2020Release notes
Open source →Added
Timer::secondsToShortTimeString()as alternative toTimer::secondsToTimeString()
Changed
Timer::start()andTimer::stop()now usehrtime()(high resolution monotonic timer) instead ofmicrotime()Timer::timeSinceStartOfRequest()now usesTimer::secondsToShortTimeString()for time formatting- Improved formatting of
Timer::secondsToTimeString()result
-
3.0.007 Feb 2020 -
2.1.401 Mar 2024Nothing published for this version
-
2.1.330 Nov 2020Nothing published for this version
-
2.1.207 Jun 2019Release notes
Open source →Fixed
- #21: Formatting of memory consumption does not work on 32bit systems
-
2.1.120 Feb 2019 -
2.1.020 Feb 2019 -
2.0.001 Feb 2018Release notes
Open source →Changed
- This component now uses namespaces
Removed
- This component is no longer supported on PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, and PHP 7.0
-
1.0.926 Feb 2017Nothing published for this version
-
1.0.812 May 2016Nothing published for this version
-
1.0.721 Jun 2015Nothing published for this version
-
1.0.613 Jun 2015Nothing published for this version
-
1.0.502 Aug 2013Nothing published for this version
-
1.0.411 Oct 2012Nothing published for this version
-
1.0.323 Sep 2012Nothing published for this version