deno.land / std@0.167.0 / node / internal_binding / _listen.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license./** * @param n Number to act on. * @return The number rounded up to the nearest power of 2. */export function ceilPowOf2(n: number) { const roundPowOf2 = 1 << (31 - Math.clz32(n));
return roundPowOf2 < n ? roundPowOf2 * 2 : roundPowOf2;}
/** Initial backoff delay of 5ms following a temporary accept failure. */export const INITIAL_ACCEPT_BACKOFF_DELAY = 5;
/** Max backoff delay of 1s following a temporary accept failure. */export const MAX_ACCEPT_BACKOFF_DELAY = 1000;
std

Version Info

Tagged at
a year ago