soyuka / pidusage

Cross-platform process cpu % and memory usage of a PID
MIT License
512 stars 55 forks source link

pidusage do not stop #91

Closed itayayuichiro closed 5 years ago

itayayuichiro commented 5 years ago

I use pidusage as follows, but if it is executed, the process keeps moving and does not stop ....

const stats = pidusage(1)
console.log(stats)

Why does the process not stop?

スクリーンショット 2019-07-18 14 55 15

pidusage version is 2.0.17

soyuka commented 5 years ago

Hi, because pidusage listens on some asynchronous events. To free it please use: pidusage.clear()

itayayuichiro commented 5 years ago

Thank you very much !!!