New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cpu-timer

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpu-timer

TODO

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

cpu-timer

easy to use

var cpuTimer = require( 'cpu-timer' )

var timer = cpuTimer.create()
setTimeout(function () {
  var cpu = timer.cpu()
  console.log( 'process usage: ' + cpu.usage + ' %' )
  console.log( 'system total average: ' + cpu.average + ' %' )
}, 1000)

// or help functions setTimeout and setInterval

cpuTimer.setTimeout(function ( cpu ) {
  console.log( 'process usage: ' + cpu.usage + ' %' )
  console.log( 'system total average: ' + cpu.average + ' %' )
}, 1000)

API

var cpuTimer = require( 'cpu-timer' )

cpuTimer.setTimeout( callback, delay ) // get process and system average cpu % over 'delay' ms

cpuTimer.setInterval( callback, delay ) // safe setInterval ( using setTimeout's, not setInterval )

var timer = cpuTimer.create( callback, delay ) // returns a timer

// get usage and system average cpu % since the last time timer.cpu() was called
// ( called implicitly on creation )
var cpu = timer.cpu() // cpu { usage: 0-100, average: 0-100 }

About

TODO

How

TODO

test

npm test

Keywords

FAQs

Package last updated on 09 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc