Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using monotonic clock #9

Open
CMCDragonkai opened this issue Mar 15, 2017 · 4 comments
Open

Using monotonic clock #9

CMCDragonkai opened this issue Mar 15, 2017 · 4 comments

Comments

@CMCDragonkai
Copy link

You can integrate with this: https://github.com/adrianguenter/php-posix-realtime

Not sure about Windows support.

@CMCDragonkai
Copy link
Author

Also the hrtime extension http://php.net/manual/en/book.hrtime.php

Windows support can be done via the COM extension http://stackoverflow.com/questions/23314070/how-to-use-php-com-to-invoke-kernel32-gettickcount

@Lewiscowles1986
Copy link
Owner

For now I've just tagged it up. The interface exists in the lib for you to extend your own and submit a PR; but I see no problem it's solving so it's not something I've priority to implement. Thanks though 👍

@CMCDragonkai
Copy link
Author

CMCDragonkai commented Mar 29, 2017

Cool thanks, the main problem it's solving is to acquire strictly monotonic increasing time, or just increasing monotonic time, because the native time source can either go backwards in time or give you the same time value. Without this, you could get the wrong order for distributed events.

But yes, it would be something for others to include into their PHP if necessary.

@Lewiscowles1986
Copy link
Owner

I'm open to a PR if you feel up to it. It looks like it's an approach to network time. Honestly I don't use ULID, I read about it and implemented based upon the .NET implementation, then decided after some tests it wasn't right for my business or my software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants