PHPackages                             clsasc/equivalent-time - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. clsasc/equivalent-time

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

clsasc/equivalent-time
======================

A class based implementation of the British Swimming/SPORTSYSTEMS Equivalent Time Algorithm.

v1.3(7y ago)21.8k↓47.1%1[1 issues](https://github.com/Chester-le-Street-ASC/EquivalentTime/issues)Apache-2.0PHPPHP &gt;=5.6

Since Aug 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Chester-le-Street-ASC/EquivalentTime)[ Packagist](https://packagist.org/packages/clsasc/equivalent-time)[ Docs](https://github.com/Chester-le-Street-ASC/EquivalentTime)[ RSS](/packages/clsasc-equivalent-time/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)DependenciesVersions (7)Used By (0)

EquivalentTime
==============

[](#equivalenttime)

A class based implementation of the British Swimming/SPORTSYSTEMS Equivalent Time Algorithm. Written in-house by Chester-le-Street ASC.

Basic Usage
-----------

[](#basic-usage)

1. Install via composer

```
composer require clsasc/equivalent-time

```

2. From there, create an EquivalentTime Object in your project

```
use CLSASC\EquivalentTime\EquivalentTime;
$object = new EquivalentTime("25m", "200 Free", 116.68);
```

Parameter 1 is the length of the source pool, Parameter 2 is the event and Parameter 3 is the time, formatted as a float, `seconds.hundreds` - You may wish to cast this to a float, just in case your code takes in time as a string.

3. Choose if you want the output to be formatted as a string or a float. Float output is default, but you can get it as an 'alpha format' (MM:SS:H) string by invoking the `setOutputAsString();` method on your object. Switch back by calling the `setOutputAsReal();` method on your object.
4. Get your output. `PHP $object->getConversion("50m"); ` Where the parameter is the length of pool you would like your time to be converted to.
5. You can call the `getConversion($length)` method on your conversion object as many times as you wish. To convert another time, create a new object and the old one will be garbage collected by PHP after it is no longer referenced.

Documentation
-------------

[](#documentation)

[Full API Style documentation](/docs) is available (phpDocumentor).

Accepted Source Pool Lengths
----------------------------

[](#accepted-source-pool-lengths)

Source Pool Length names are shown as they should be entered as a string to the converter object.

The same strings as listed below should be used when calling a method to obtain a converted time, though you should always `try {...} catch (Exception ...) {...}`when calling the method as if the event cannot be swum in the distance you have requested, the converter will throw an exception to alert you to the problem.

- `20m`
- `25m`
- `33 1/3m`
- `50m`
- `20y`
- `25y`
- `26 2/3y`
- `27 1/2y`
- `33 1/3y`

Accepted Events
---------------

[](#accepted-events)

Below is a list of events accepted by the time converter. Some events are only accepted for a subset of source pool lengths, described by the list following the event name. If you do try to create an object with an event and source pool length which are incompatible, an exception will be thrown, which you should `catch...`.

Event names are shown as they should be entered as a string to the converter object.

- `50 Free` is allowed with the following source pool lengths;
    - `50m`
    - `25m`
    - `27 1/2y`
    - `25y`
- `100 Free`
- `200 Free`
- `400 Free`
- `800 Free`
- `1500 Free` is not allowed with the following source pool lengths;
    - `33 1/3y`
    - `20y`
- `50 Breast` is allowed with the following source pool lengths;
    - `50m`
    - `25m`
    - `27 1/2y`
    - `25y`
- `100 Breast`
- `200 Breast`
- `50 Fly` is allowed with the following source pool lengths;
    - `50m`
    - `25m`
    - `27 1/2y`
    - `25y`
- `100 Fly`
- `200 Fly`
- `50 Back` is allowed with the following source pool lengths;
    - `50m`
    - `25m`
    - `27 1/2y`
    - `25y`
- `100 Back`
- `200 Back`
- `200 IM`
- `400 IM`

Exceptions
----------

[](#exceptions)

The system will throw exceptions for error conditions. [Please read the docs](/docs) for full details on these.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~34 days

Total

6

Last Release

2686d ago

Major Versions

v0.3-beta → v1.02018-08-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4922335?v=4)[Chris Heppell](/maintainers/clheppell)[@clheppell](https://github.com/clheppell)

---

Top Contributors

[![clheppell](https://avatars.githubusercontent.com/u/4922335?v=4)](https://github.com/clheppell "clheppell (28 commits)")

---

Tags

british-swimmingswimmingtime-conversion

### Embed Badge

![Health badge](/badges/clsasc-equivalent-time/health.svg)

```
[![Health](https://phpackages.com/badges/clsasc-equivalent-time/health.svg)](https://phpackages.com/packages/clsasc-equivalent-time)
```

###  Alternatives

[inc2734/wp-breadcrumbs

A library for WordPress breadcrumbs.

1543.1k1](/packages/inc2734-wp-breadcrumbs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
