Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/navarr/precise-clocks
Specified Precision Clocks (PSR-20)
https://github.com/navarr/precise-clocks
Last synced: about 6 hours ago
JSON representation
Specified Precision Clocks (PSR-20)
- Host: GitHub
- URL: https://github.com/navarr/precise-clocks
- Owner: navarr
- License: mit
- Created: 2021-08-29T05:20:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-26T19:07:47.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T19:32:15.395Z (6 months ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Specified Precision Clocks (PSR-20)
[![Latest Stable Version](http://poser.pugx.org/navarr/precise-clocks/v)](https://packagist.org/packages/navarr/precise-clocks)
[![Total Downloads](http://poser.pugx.org/navarr/precise-clocks/downloads)](https://packagist.org/packages/navarr/precise-clocks)
[![Latest Unstable Version](http://poser.pugx.org/navarr/precise-clocks/v/unstable)](https://packagist.org/packages/navarr/precise-clocks)
[![License](http://poser.pugx.org/navarr/precise-clocks/license)](https://packagist.org/packages/navarr/precise-clocks)
![Tests](https://github.com/navarr/precise-clocks/actions/workflows/commit.yml/badge.svg)
![Code Coverage](https://codecov.io/gh/navarr/precise-clocks/branch/main/graph/badge.svg?token=BHTKOZZDR3)
[![Mutation score](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fnavarr%2Fprecise-clocks%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/navarr/precise-clocks/main)This library contains implementations of PSR-20 that provides a clocks that are precise to their namesake, and while in the same time to that precision, return the exact same object.
## Installation
composer require navarr/precise-clocks:^1
## Usage
```php
use Navarr\PreciseClock\MinutePrecisionClock;$clock = new MinutePrecisionClock();
$a = $clock->now();
$b = $clock->now();spl_object_id($a) === spl_object_id($b); // true
```