<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/who-wound-the-clock--san6dquft" -->

---
title: Who wound the clock? | daily.dev
description: PHPUnit historically measured elapsed test time using $_SERVER[&#x27;REQUEST_TIME_FLOAT&#x27;] and microtime(), which caused recurring bugs when test or production code...
canonical: https://daily.dev/posts/who-wound-the-clock--san6dquft
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Who wound the clock? | daily.dev
og:description: PHPUnit historically measured elapsed test time using $_SERVER[&#x27;REQUEST_TIME_FLOAT&#x27;] and microtime(), which caused recurring bugs when test or production code...
og:url: https://daily.dev/posts/who-wound-the-clock--san6dquft
og:image: https://api.daily.dev/og/posts/SAN6DQUfT.png
og:image:alt: Who wound the clock?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Who wound the clock?

**[PHPUnit Expert](https://daily.dev/sources/phpunit-expert)** · 4 min read · 0 upvotes · 0 comments

## Summary

PHPUnit historically measured elapsed test time using $_SERVER['REQUEST_TIME_FLOAT'] and microtime(), which caused recurring bugs when test or production code modified or unset that super-global. PHPUnit 9.2 solves this by switching to hrtime(), introduced in PHP 7.3, which provides a high-resolution monotonic timer unaffected by system clock changes or super-global manipulation. The phpunit/php-timer component was rewritten from scratch for version 4.0 to use hrtime() exclusively.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://phpunit.expert/articles/who-wound-the-clock.html>

## Similar posts on daily.dev

- [PSR-20 Clocks: Testable Time in PHP](https://daily.dev/posts/psr-20-clocks-testable-time-in-php-0di7tgkjy) · FREEK.DEV · 5 upvotes · 0 comments
- [What your test run already knows](https://daily.dev/posts/what-your-test-run-already-knows-uye6kwsti) · PHPUnit Expert · 3 upvotes · 1 comments
- [Time is an illusion, CLOCK\_REALTIME, doubly so...](https://daily.dev/posts/time-is-an-illusion-clock-realtime-doubly-so--hycuaz0ky) · Rambling Comments · 0 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#php](https://daily.dev/tags/php), [#phpunit](https://daily.dev/tags/phpunit)

[View this post on daily.dev](https://daily.dev/posts/who-wound-the-clock--san6dquft)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Who wound the clock?","url":"https://daily.dev/posts/who-wound-the-clock--san6dquft","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/who-wound-the-clock--san6dquft"},"datePublished":"2026-03-31T13:34:21.707Z","dateModified":"2026-03-31T13:35:00.567Z","description":"PHPUnit historically measured elapsed test time using $_SERVER['REQUEST_TIME_FLOAT'] and microtime(), which caused recurring bugs when test or production code...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fb7e49b95b1848183aab4b979a4cc640?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fb7e49b95b1848183aab4b979a4cc640?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"PHPUnit Expert","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"PHPUnit Expert","logo":"https://media.daily.dev/image/upload/s--FMZoysoG--/f_auto,q_auto/v1774964057/logos/phpunit-expert?_a=BAMAMiWQ0","url":"https://daily.dev/sources/phpunit-expert"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/who-wound-the-clock--san6dquft","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,php,phpunit","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PHPUnit Expert","item":"https://daily.dev/sources/phpunit-expert"},{"@type":"ListItem","position":3,"name":"Who wound the clock?"}]}
```

