2017 © Pedro Peláez
 

package time

PHP time package

image

shaked/time

PHP time package

  • Tuesday, January 16, 2018
  • by shaked
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,135 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 11 % Grown

The README.md

PHP time package

Build Status, (*1)

The purpose of this package is to help developers to write a more readable PHP code while being able to easily test it., (*2)

The code is very much influenced by the Go time package., (*3)

Usage

@see TimeTest for more information., (*4)

<?php

require_once 'vendor/autoload.php';

use shaked\time\Duration;

$n = 60;

$durations = [
    'nanosecond'  => Duration::nanosecond($n),
    'microsecond' => Duration::microsecond($n),
    'millisecond' => Duration::millisecond($n),
    'second'      => Duration::second($n),
    'minute'      => Duration::minute($n),
    'hour'        => Duration::hour($n),
];

foreach ($durations as $duration) {
    (new Sleep())->for($duration);
    echo (string) $duration . PHP_EOL;
}

// 60ns
// 60µs
// 60ms
// 1m0s
// 1h0m0s
// 60h0m0s

The Versions

16/01 2018

dev-master

9999999-dev https://github.com/Shaked/time

PHP time package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Shaked Klein Orbach

time sleep

16/01 2018

1.0.0

1.0.0.0 https://github.com/Shaked/time

PHP time package

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

by Shaked Klein Orbach

time sleep