@@ -1447,6 +1447,40 @@ The next tick queue is completely drained on each pass of the event loop
1447
1447
` nextTick() ` callbacks will block any I/O from happening, just like a
1448
1448
` while(true); ` loop.
1449
1449
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
+
1450
1484
## process.noDeprecation
1451
1485
<!-- YAML
1452
1486
added: v0.8.0
@@ -1642,40 +1676,6 @@ This function is only available on POSIX platforms (i.e. not Windows or
1642
1676
Android).
1643
1677
This feature is not available in [ ` Worker ` ] [ ] threads.
1644
1678
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
-
1679
1679
## process.setgid(id)
1680
1680
<!-- YAML
1681
1681
added: v0.1.31
0 commit comments