MCPcopy
hub / github.com/socketio/socket.io / times

Function times

packages/socket.io-cluster-adapter/test/util.ts:1–9  ·  packages/socket.io-cluster-adapter/test/util.ts::times
(count: number, fn: () => void)

Source from the content-addressed store, hash-verified

1export function times(count: number, fn: () => void) {
2 let i = 0;
3 return () => {
4 i++;
5 if (i === count) {
6 fn();
7 }
8 };
9}
10
11export function sleep(duration: number) {
12 return new Promise((resolve) => setTimeout(resolve, duration));

Callers 1

index.tsFile · 0.90

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected