MCPcopy Create free account
hub / github.com/Marus/cortex-debug / timeIt

Function timeIt

test/suite/tcpportscanner.test.ts:19–27  ·  view source on GitHub ↗
(reset: boolean = false)

Source from the content-addressed store, hash-verified

17 test('TcpPortScanner finder/waitfor(open/close) tests', async () => {
18 let hrStart = process.hrtime();
19 function timeIt(reset: boolean = false): string {
20 const hrEnd = process.hrtime(hrStart);
21 const ms = (hrEnd[1] / 1e6).toFixed(2);
22 const ret = `${hrEnd[0]}s ${ms}ms`;
23 if (reset) {
24 hrStart = process.hrtime();
25 }
26 return ret;
27 }
28 const doLog = false;
29 const args = {
30 min: 51000,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected