-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Replace microtime() usages with hrtime() #2242
Replace microtime() usages with hrtime() #2242
Conversation
Would be better to declare a guzzle specific time function in https://github.com/guzzle/guzzle/blob/master/src/functions.php, instead of copy-pasting this code all over the place. |
Introduced a new wrapper function |
I am not sure why the discussion is resolved.. but unless if guzzle maintainers say otherwise I still insist on my proposal to mark the function |
The reason suggesting the underscore is only for consistency with the rest of them.. in general I am not in favor of it.. but none the less I believe that it should be marked as internal in order not to have it under BC promise. |
It must be |
I realized I saw that the change to |
Thank you @Llbe. You are correct. One must never mix hrtime and microtime. 1e9 is correct. My bad. |
@Nyholm reverted back to 1e9. Let me know if further changes are needed or we can merge. |
Thank you. I see that you have not resolved @gmponos concern yet. If we mark the function as internal we can easily change it later if we want to. Say that we want to introduce |
I see. Marked is as |
@Nyholm is there something else that stops these changes from being "mergeable"? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last thing then Im happy to merge.
src/functions.php
Outdated
* @return float|mixed UNIX timestamp | ||
* @internal | ||
*/ | ||
function current_time() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor thing. All our other internal methods starts with an underscore. Please rename to _current_time()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Symfony has a polyfill for the |
Hello @Dzhuneyt, i create a fork of this repo and release this marge request into the new version(6.4.0). Namespace compatibility is 100%, and you can use my changes if you patch composer.json in your projects
Fork link: https://github.com/SomeBlackMagic/guzzle/ |
Fixes #2214
There are 5 test failures, but they are not caused by this PR. They are failing on master as well.