Comparing version 0.1.3 to 0.2.0
@@ -23,3 +23,5 @@ // Generated by CoffeeScript 1.8.0 | ||
module.exports.includeChildProcesses = false; | ||
/* | ||
@@ -46,3 +48,3 @@ @param {Number} [pid] Process ID. | ||
return fs.readFile("/proc/" + pid + "/stat", "ascii", function(err, data) { | ||
var parts; | ||
var parts, time; | ||
if (err) { | ||
@@ -52,3 +54,7 @@ return done(err); | ||
parts = data.split(' '); | ||
return done(null, (parseInt(parts[13]) + parseInt(parts[14])) / CLK_TCK); | ||
time = parseInt(parts[13]) + parseInt(parts[14]); | ||
if (module.exports.includeChildProcesses) { | ||
time += parseInt(parts[15]) + parseInt(parts[16]); | ||
} | ||
return done(null, time / CLK_TCK); | ||
}); | ||
@@ -55,0 +61,0 @@ case 'darwin': |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"main": "index.js", | ||
@@ -15,0 +15,0 @@ "repository": { |
@@ -23,2 +23,6 @@ # node-cputime [![Dependency Status](https://david-dm.org/patriksimek/cputime.png)](https://david-dm.org/patriksimek/cputime) [![NPM version](https://badge.fury.io/js/cputime.png)](http://badge.fury.io/js/cputime) | ||
## Options | ||
`cput.includeChildProcesses` - Default: `false`. Doesn't work on Windows and OS X. | ||
<a name="license" /> | ||
@@ -25,0 +29,0 @@ ## License |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7569
118
39