doc: update os.uptime() and process.uptime() descriptions#12294
doc: update os.uptime() and process.uptime() descriptions#12294vsemozhetbyt wants to merge 1 commit intonodejs:masterfrom vsemozhetbyt:os-uptime
Conversation
doc/api/os.md
Outdated
There was a problem hiding this comment.
I would phrase it as:
-*Note*: On Windows (and maybe other platforms as well) the value returned includes fractions of a second.
There was a problem hiding this comment.
(and maybe other platforms as well)
The docs are the canonical source for what our API does, we should be exact. I don't think there are any other platforms that do fractions of a second, but if there are, we can update the docs.
There was a problem hiding this comment.
we should be exact.
@gibfahn I agree in principle, can we figure this out exactly? Until recently we had a hard time list all supported platform (#11872). Mentioning Windows has an implicit meaning that it's only on Windows. And as @bnoordhuis said
UNIX implementations of that function don't currently bother to mix in the sub-second fraction. That could change in the future though, if someone requests it.
There was a problem hiding this comment.
So:
-*Note*: The value returned may include fractions of a second (on Windows it consistently does, on others it's not defined).
There was a problem hiding this comment.
I checked macOS, Ubuntu 16.04, SmartOS 16, FreeBSD 11, and AIX 6.1, and they're all consistent (os.uptime() is an integer, process.uptime() is not). Given that, I'd say we're okay to specify that it's just Windows.
If it changes in the future then the PR to change it should update the docs, making it a semver-major change.
There was a problem hiding this comment.
-*Note*: The value returned may include fractions of a second (on Windows it consistently returns a float. Other platforms currently returns an integer but may change in the future).
There was a problem hiding this comment.
PR to change it should update the docs, making it a semver-major change.
It might get changed by the OS, under us
There was a problem hiding this comment.
@refack Could you repeat the proposed wording in the main thread? Somebody may not look in the outdated discussion.
|
maybe add the same to process.md:1669 |
|
@refack |
@vsemozhetbyt You could just include this bit in
|
|
Is |
|
@vsemozhetbyt No. I've rephrased, and would wait for a +1 from some else |
Proposing: |
|
I have too many lawyer friends... |
I'm pretty sure the UNIX implementations @bnoordhuis is talking about in #12291 (comment) are in libuv, not in the OS itself. So it can only change in a libuv update (which would need to update the docs). EDIT: e.g. here See also libuv/libuv@556fe1a |
Let me look... |
yep, saw it. So phrase: |
|
Ref: libuv/libuv#1294 |
|
I've updated according to the last proposition for now. @nodejs/documentation PTAL |
|
Landed in 9b6376a |
|
Can someone confirm that that is true for v6.x |
ping @vsemozhetbyt |
|
@gibfahn It seems this is true for the last v6. Does this land cleanly or should I make a backport PR? |
|
Lands cleanly |
Checklist
Affected core subsystem(s)
doc, os
Fixes: #12291