Skip to content

Commit aadb65b

Browse files
committed
fixup: implement doc improvements by vsemozhetbyt
1 parent 01b0643 commit aadb65b

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

doc/api/process.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,40 @@ The next tick queue is completely drained on each pass of the event loop
14471447
`nextTick()` callbacks will block any I/O from happening, just like a
14481448
`while(true);` loop.
14491449

1450+
## process.nice([inc])
1451+
<!-- YAML
1452+
added: REPLACEME
1453+
-->
1454+
1455+
* `inc` {integer} The nice value which is added to the current nice value.
1456+
* Returns: {integer} The new nice value for the process.
1457+
1458+
The `process.nice()` method sets or gets the nice value of the process.
1459+
(See nice(2).) The `inc` is supposed to be an integer, consisting of the
1460+
_difference_ to be added to the current nice value of the process.
1461+
The higher the nice value of the process, the nicer the process and the less
1462+
time is given by the scheduler (effectively lowering the priority).
1463+
1464+
It is possible to get the current nice value by passing `0` or `undefined`
1465+
to the method.
1466+
1467+
In a common environment, it is only possible to increase the nice value.
1468+
A decrease of the value at a later time might not be possible (unless
1469+
the specified permissions are set). (See getrlimit(2).)
1470+
1471+
```js
1472+
if (process.platform !== 'win32') {
1473+
const currentNice = process.nice();
1474+
console.log(currentNice); // Prints the current nice value.
1475+
1476+
process.nice(1); // Increases nice value - giving it less priority.
1477+
}
1478+
```
1479+
1480+
This function works only on POSIX platforms and throws not implemented errors
1481+
on other platforms.
1482+
This feature is not available in [`Worker`][] threads.
1483+
14501484
## process.noDeprecation
14511485
<!-- YAML
14521486
added: v0.8.0
@@ -1642,40 +1676,6 @@ This function is only available on POSIX platforms (i.e. not Windows or
16421676
Android).
16431677
This feature is not available in [`Worker`][] threads.
16441678

1645-
## process.nice(inc)
1646-
<!-- YAML
1647-
added: REPLACEME
1648-
-->
1649-
1650-
* `inc` {integer} The nice value which is added to the current nice value.
1651-
1652-
Returns the new nice value of the process.
1653-
1654-
The `process.nice()` method sets or gets the nice value of the process.
1655-
(See nice(2).) The `inc` is supposed to be an integer, consisting of the
1656-
_difference_ to be added to the current nice value of the process.
1657-
The higher the nice value of the process, the nicer the process and the less
1658-
time is given by the scheduler (effectively lowering the priority).
1659-
1660-
It is possible to get the current nice value by passing 0 or `undefined`
1661-
to the method.
1662-
1663-
In a common environment, it is only possible to increase the nice value.
1664-
A decrease of the value at a later time might not be possible (unless
1665-
the specified permissions are set) (See getrlimit(2).)
1666-
1667-
```js
1668-
if (process.nice) {
1669-
const currentNice = process.nice();
1670-
console.log(currentNice); // Prints the current nice value
1671-
1672-
process.nice(1); // Increases nice value - giving it less priority.
1673-
}
1674-
```
1675-
1676-
This function is only available on POSIX platforms (i.e. not Windows).
1677-
This feature is not available in [`Worker`][] threads.
1678-
16791679
## process.setgid(id)
16801680
<!-- YAML
16811681
added: v0.1.31

0 commit comments

Comments
 (0)