UNPKG

spawn-workers

Version:

A high-performance worker pool library for Node.js that spawns worker processes to handle tasks in parallel

11 lines 266 B
export function throttle(func, delay) { let lastCall = 0; return (...args) => { const now = Date.now(); if (now - lastCall >= delay) { lastCall = now; func(...args); } }; } //# sourceMappingURL=utils.js.map