MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / memToString

Function memToString

test/utils.ts:343–353  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

341 n /= 1024;
342 if (n < 1024) return n.toFixed(1) + ' kB';
343 n /= 1024;
344 if (n < 1024) return n.toFixed(1) + ' MB';
345 n /= 1024;
346 if (n < 1024) return n.toFixed(1) + ' GB';
347 n /= 1024;
348 return n.toFixed(2) + ' TB';
349}
350
351function timeToString(t: number): string {
352 if (t < 1000) return t.toFixed(2) + ' ms';
353 t /= 1000;
354 return t.toFixed(2) + ' s';
355}
356

Callers 1

benchmarkFunction · 0.85

Calls 1

toFixedMethod · 0.80

Tested by

no test coverage detected