MCPcopy Index your code
hub / github.com/nodejs/node / main

Function main

benchmark/buffers/buffer-isascii.js:14–23  ·  view source on GitHub ↗
({ n, input })

Source from the content-addressed store, hash-verified

12
13
14function main({ n, input }) {
15 const normalizedInput = input === 'short' ? input : input.repeat(200);
16 const encoder = new TextEncoder();
17 const buff = encoder.encode(normalizedInput);
18 bench.start();
19 for (let i = 0; i < n; ++i) {
20 assert.ok(buffer.isAscii(buff));
21 }
22 bench.end(n);
23}

Callers

nothing calls this directly

Calls 5

encodeMethod · 0.95
isAsciiMethod · 0.80
startMethod · 0.45
okMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected