strict-throttle:严格延迟(速率限制)函数调用的执行

时间:2021-05-10 17:19:57
【文件属性】:
文件名称:strict-throttle:严格延迟(速率限制)函数调用的执行
文件大小:21KB
文件格式:ZIP
更新时间:2021-05-10 17:19:57
JavaScript 严格的油门 严格延迟(速率限制)函数调用的执行,以确保函数调用的执行时间不超过给定间隔内提供的限制时间。 严格的节流阀在滚动窗口中运行,因此在等于interval的任何时间段内,执行的调用不得超过限制调用。 安装 $ npm install strict-throttle 例子 const throttle = require ( 'strict-throttle' ) ( { limit : 2 , interval : 1000 } ) ; const delay = require ( 'delay' ) ; async function example ( ) { const start = Date . now ( ) ; function elapsedTime ( ) { return Date . now ( ) - start ;
【文件预览】:
strict-throttle-master
----.gitignore(18B)
----README.md(2KB)
----CHANGELOG.md(868B)
----.github()
--------workflows()
----test()
--------throttle.spec.js(11KB)
----LICENSE(1KB)
----package.json(708B)
----index.js(3KB)
----index.d.ts(1KB)
----package-lock.json(42KB)

网友评论