UNPKG

@nqb/worker-pool

Version:

Node.js worker pool to utilize threads for CPU-intensive tasks

20 lines (15 loc) 272 B
let timestamp = Date.now(); let counter = 0; function getRuntimeID() { const now = Date.now(); if (timestamp !== now) { timestamp = now; counter = 0; } else { counter++; } return `${timestamp}.${counter}`; } module.exports = { getRuntimeID, };