From 4e111f6774a478cc2a438a1f9e49530e92b642ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Sat, 8 Jul 2023 19:14:29 +0200 Subject: [PATCH] Docs: move clocks into own section --- docs/README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/README.md b/docs/README.md index dc5573a..9e18e3e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,9 +9,10 @@ Provides current time for runtime and controllable time for testing - [Setup](#setup) - [Clock usage](#clock-usage) - [Shortcut function](#shortcut-function) -- [System clock](#system-clock) -- [Frozen clock](#frozen-clock) -- [Measurement clock](#measurement-clock) +- [Clock](#clock-1) + - [System clock](#system-clock) + - [Frozen clock](#frozen-clock) + - [Measurement clock](#measurement-clock) - [Integrations and extensions](#integrations-and-extensions) ## Setup @@ -67,7 +68,9 @@ use function Orisai\Clock\now; $currentTime = now(); // \DateTimeImmutable ``` -## System clock +## Clock + +### System clock For standard usage in application runtime. Returns same time as `new DateTimeImmutable('now')` would. @@ -85,7 +88,7 @@ use DateTimeZone; $clock = new SystemClock(new DateTimeZone('UTC')); ``` -## Frozen clock +### Frozen clock For testing exact times. Does not change unless explicitly requested. @@ -117,7 +120,7 @@ use DateTimeZone; $clock = new FrozenClock(0, new DateTimeZone('UTC')); ``` -## Measurement clock +### Measurement clock For accurate measurement of time. Unlike standard [system clock](#system-clock) is not affected by clock drifting (which is wanted for normal usage, but makes time measuring unreliable).