Skip to content

Use monotonic time when available #73

Closed

Description

@kelunik

Currently, PHP doesn't support and built-in way to access the system's monotonic time. That might change in PHP 7.2. I plan to implement a hrtime() function providing access to the high-resolution monotonic system time. If UV is available, but another loop is used, uv_hrtime() could be used in the meantime.

This issue exists to keep track of any improvements in PHP itself and to not forget implementing hrtime() in the future.

https://externals.io/thread/592#email-14248 updated: https://externals.io/message/97502

Activity

  1. clue commented on Feb 8, 2017

    @clue
    Member

    I think this makes perfect sense and I'm sure we're going to add this once we have a reliable hrtime() implementation available 👍

    (FWIW, this has also already been reported as part of #34)

  2. clue commented on Nov 11, 2017

    @clue
    Member

    Ping @kelunik, what is the status here? :shipit:

  3. kelunik commented on Nov 11, 2017

    @kelunik
    ContributorAuthor

    It didn't make it into PHP 7.2, maybe it'll be in PHP 7.3.

    php/php-src#2368

  4. clue commented on Dec 4, 2017

    @clue
    Member

    I still think that using a monotonic time source make perfect sense. However, this is currently not available on PHP by default and it's unclear when the above PR lands in a future PHP version.

    I'd like to make this actionable, so I've just added relevant documentation via #130 and marked this ticket as resolved for now.

    I'm happy to look into this again once a monotonic time source is available in PHP by default 👍

  5. added this to the v0.5.0 milestone on Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions