Search by

jcchavezs / nanotime

jcchavezs

An abstraction for nanotime in PHP.

Package info

github.com/jcchavezs/nanotime-php

pkg:composer/jcchavezs/nanotime

Statistics

Installs: 56 803

Dependents: 1

Suggesters: 0

Stars: 5

Open Issues: 0

0.4.0 2017-06-12 19:02 UTC

This package is auto-updated.

Last update: 2026-09-05 01:44:09 UTC


README

A couple of value objects for representing nanotime.

Usage

    $nanotime = Nanotime::now();
    usleep(1);
    $nanotime2 = Nanotime::now();
    echo $nanotime2->diff($nanotime);

Further development

This is just a wrapper for the Nanotime concept (which does not exist in PHP) that will perfectly work as an abstraction for nanotime in PHP projects. Further development will tackle the problem about getting an accurate value for nanotime.