Created
May 1, 2017 05:10
-
-
Save affixalex/6fe3e3bdbaa7ef33a4a9876b7afab8e3 to your computer and use it in GitHub Desktop.
This file contains 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
alex@amnesiac ~/mininode $ cat ~/test.js [6/1915] | |
const os = require("os"); | |
const fs = require("fs"); | |
console.log("Platform: " + os.platform()); | |
console.log("Release: " + os.release()); | |
console.log("Homedir: " + os.homedir()); | |
console.log("Uptime: " + os.uptime()); | |
console.log("TotalMem: " + os.totalmem()); | |
console.log("FreeMem: " + os.freemem()); | |
console.log("CPUs: " + JSON.stringify(os.cpus())); | |
fs.access("/tmp", fs.F_OK | fs.R_OK | fs.X_OK, function(err) { | |
if (err) { | |
console.log(err); | |
} else { | |
console.log("success, we did it"); | |
} | |
}); | |
alex@amnesiac ~/mininode $ time node ~/test.js | |
Platform: darwin | |
Release: 15.0.0 | |
Homedir: /Users/alex | |
Uptime: 3082599 | |
TotalMem: 8589934592 | |
FreeMem: 73740288 | |
CPUs: [{"model":"Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz","speed":1696,"times": | |
{"user":187060860,"nice":0,"sys":173813240,"idle":2721713630,"irq":0}},{"model": | |
"Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz","speed":1696,"times":{"user":62455430 | |
,"nice":0,"sys":43247550,"idle":2976883510,"irq":0}},{"model":"Intel(R) Core(TM) | |
i3-4005U CPU @ 1.70GHz","speed":1696,"times":{"user":174564950,"nice":0,"sys":1 | |
26769360,"idle":2781252180,"irq":0}},{"model":"Intel(R) Core(TM) i3-4005U CPU @ | |
1.70GHz","speed":1696,"times":{"user":65194720,"nice":0,"sys":46098700,"idle":29 | |
71293070,"irq":0}}] | |
success, we did it | |
node ~/test.js 0.10s user 0.09s system 61% cpu 0.312 total | |
alex@amnesiac ~/mininode $ time ./mininode ~/test.js | |
Platform: darwin | |
Release: 15.0.0 | |
Homedir: /Users/alex | |
Uptime: 3082604 | |
TotalMem: 8589934592 | |
FreeMem: 82337792 | |
CPUs: [{"model":"Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz","speed":1696,"times": | |
{"user":187061150,"nice":0,"sys":173813510,"idle":2721718260,"irq":0}},{"model": | |
"Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz","speed":1696,"times":{"user":62455480 | |
,"nice":0,"sys":43247590,"idle":2976888610,"irq":0}},{"model":"Intel(R) Core(TM$ | |
i3-4005U CPU @ 1.70GHz","speed":1696,"times":{"user":174565200,"nice":0,"sys":1 | |
26769540,"idle":2781256940,"irq":0}},{"model":"Intel(R) Core(TM) i3-4005U CPU @ | |
1.70GHz","speed":1696,"times":{"user":65194750,"nice":0,"sys":46098750,"idle":29 | |
71298170,"irq":0}}] | |
success, we did it | |
./mininode ~/test.js 0.00s user 0.00s system 78% cpu 0.007 total | |
alex@amnesiac ~/mininode $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment