diff --git a/doc/api/v8.md b/doc/api/v8.md index 2968c267dc6f87..629fa5ee9425e8 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -236,7 +236,18 @@ be reset and a new coverage report will be written to the directory specified by [`NODE_V8_COVERAGE`][]. When the process is about to exit, one last coverage will still be written to -disk. +disk, unless [`v8.stopCoverage()`][] is invoked before the process exits. + +## `v8.stopCoverage()` + + + +The `v8.stopCoverage()` method allows the user to stop the coverage collection +started by [`NODE_V8_COVERAGE`][], so that V8 can release the execution count +records and optimize code. This can be used in conjunction with +`v8.takeCoverage()` if the user wants to collect the coverage on demand. ## `v8.writeHeapSnapshot([filename])`