MCPcopy Create free account
hub / github.com/tensorflow/tfjs / time

Method time

tfjs-node/src/nodejs_kernel_backend.ts:686–693  ·  view source on GitHub ↗
(f: () => void)

Source from the content-addressed store, hash-verified

684 }
685
686 async time(f: () => void): Promise<BackendTimingInfo> {
687 const start = process.hrtime();
688 f();
689 // hrtime() returns tuple of [seconds, nanoseconds], and we need to return
690 // milliseconds.
691 const elapsed = process.hrtime(start);
692 return {kernelMs: elapsed[0] * 1000 + elapsed[1] / 1000000};
693 }
694
695 getNumOfSavedModels() {
696 return this.binding.getNumOfSavedModels();

Callers

nothing calls this directly

Calls 1

fFunction · 0.50

Tested by

no test coverage detected