@@ -798,7 +798,7 @@ added: v0.1.13
798
798
* ` code ` {Integer} The exit code. Defaults to ` 0 ` .
799
799
800
800
The ` process.exit() ` method instructs Node.js to terminate the process as
801
- quickly as possible with the specified exit ` code ` . If the ` code ` is omitted,
801
+ quickly as possible with the specified exit ` code ` . If the ` code ` is omitted,
802
802
exit uses either the 'success' code ` 0 ` or the value of ` process.exitCode ` if
803
803
specified.
804
804
@@ -811,7 +811,7 @@ process.exit(1);
811
811
The shell that executed Node.js should see the exit code as ` 1 ` .
812
812
813
813
It is important to note that calling ` process.exit() ` will force the process to
814
- exit as quickly as possible * even if there are still asynchronous operations
814
+ exit as quickly as possible * even if there are still asynchronous operations
815
815
pending* that have not yet completed fully, * including* I/O operations to
816
816
` process.stdout ` and ` process.stderr ` .
817
817
@@ -820,8 +820,8 @@ explicitly. The Node.js process will exit on it's own *if there is no additional
820
820
work pending* in the event loop. The ` process.exitCode ` property can be set to
821
821
tell the process which exit code to use when the process exits gracefully.
822
822
823
- For instance, the following example illustrates a * misuse* of the
824
- ` process.exit() ` method that could lead to data printed to stdout being
823
+ For instance, the following example illustrates a * misuse* of the
824
+ ` process.exit() ` method that could lead to data printed to stdout being
825
825
truncated and lost:
826
826
827
827
``` js
@@ -863,7 +863,7 @@ A number which will be the process exit code, when the process either
863
863
exits gracefully, or is exited via [ ` process.exit() ` ] [ ] without specifying
864
864
a code.
865
865
866
- Specifying a code to [ ` process.exit(code) ` ] [ `process.exit()` ] will override any
866
+ Specifying a code to [ ` process.exit(code) ` ] [ `process.exit()` ] will override any
867
867
previous setting of ` process.exitCode ` .
868
868
869
869
@@ -947,15 +947,18 @@ if (process.getuid) {
947
947
}
948
948
```
949
949
950
- ## process.hrtime()
950
+ ## process.hrtime([ time ] )
951
951
<!-- YAML
952
952
added: v0.7.6
953
953
-->
954
954
955
955
Returns the current high-resolution real time in a ` [seconds, nanoseconds] `
956
- tuple Array. It is relative to an arbitrary time in the past. It is not
957
- related to the time of day and therefore not subject to clock drift. The
958
- primary use is for measuring performance between intervals.
956
+ tuple Array. ` time ` is an optional parameter that must be the result of a
957
+ previous ` process.hrtime() ` call (and therefore, a real time in a
958
+ ` [seconds, nanoseconds] ` tuple Array containing a previous time) to diff with
959
+ the current time. These times are relative to an arbitrary time in the past,
960
+ and not related to the time of day and therefore not subject to clock drift.
961
+ The primary use is for measuring performance between intervals.
959
962
960
963
You may pass in the result of a previous call to ` process.hrtime() ` to get
961
964
a diff reading, useful for benchmarks and measuring intervals:
@@ -973,6 +976,9 @@ setTimeout(() => {
973
976
}, 1000 );
974
977
```
975
978
979
+ Constructing an array by some method other than calling ` process.hrtime() ` and
980
+ passing the result to process.hrtime() will result in undefined behavior.
981
+
976
982
977
983
## process.initgroups(user, extra_group)
978
984
<!-- YAML
0 commit comments