Created
August 2, 2022 16:53
-
-
Save Jamelle-Boose/31f99437788fe180d6e016cd803af846 to your computer and use it in GitHub Desktop.
Get process memory usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const allFileContents = fs.readFileSync('broadband.sql', 'utf-8'); | |
allFileContents.split(/\r?\n/).forEach(line => { | |
console.log(`Line from file: ${line}`); | |
}); | |
const used = process.memoryUsage().heapUsed / 1024 / 1024; | |
console.log(`The script uses approximately ${Math.round(used * 100) / 100} MB`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment