MCPcopy Index your code
hub / github.com/codeaashu/claude-code / addJitter

Function addJitter

src/bridge/bridgeMain.ts:1615–1617  ·  view source on GitHub ↗

Add ±25% jitter to a delay value.

(ms: number)

Source from the content-addressed store, hash-verified

1613
1614/** Add ±25% jitter to a delay value. */
1615function addJitter(ms: number): number {
1616 return Math.max(0, ms + ms * 0.25 * (2 * Math.random() - 1))
1617}
1618
1619function formatDelay(ms: number): string {
1620 return ms >= 1000 ? `${(ms / 1000).toFixed(1)}s` : `${Math.round(ms)}ms`

Callers 2

runBridgeLoopFunction · 0.85
stopWorkWithRetryFunction · 0.85

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected