Skip to content

pure javascript implememtation to get `sysconf(_SC_CLK_TCK))` value

License

Notifications You must be signed in to change notification settings

longtian/cpu-clock-ticks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpu-clock-ticks


pure javascript implementation to get sysconf(_SC_CLK_TCK)) value

NPM Version NPM Downloads Linux Build Test Coverage

Sample Code

var cct=require('cpu-clock-ticks');
console.log('Clock ticks for CPU is %d HZ',cct());

Normally it will be 100HZ.

Inspiration

node-usage

Limitation

Works only on Linux ( tested on Ubuntu and CentOS ), because the code assumes /proc/{pid}/stat exists.

Validation

Execute following command will return _SC_CLK_TCK

getconf CLK_TCK

License

MIT

About

pure javascript implememtation to get `sysconf(_SC_CLK_TCK))` value

Resources

License

Stars

Watchers

Forks

Packages