Skip to content

Commit

Permalink
Docs: move clocks into own section
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Jul 8, 2023
1 parent 12acc0c commit 4e111f6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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).
Expand Down

0 comments on commit 4e111f6

Please sign in to comment.