Replace microtime() usages with hrtime()#2242
Replace microtime() usages with hrtime()#2242Nyholm merged 6 commits intoguzzle:masterfrom Dzhuneyt:2214-replace-microtime-with-hrtime
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"? |
Nyholm
left a comment
There was a problem hiding this comment.
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.
One minor thing. All our other internal methods starts with an underscore. Please rename to _current_time()
|
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.