MCPcopy Index your code
hub / github.com/ericdrowell/ElGrapho / Profiler

Function Profiler

engine/src/Profiler.js:1–14  ·  view source on GitHub ↗
(funcName, func)

Source from the content-addressed store, hash-verified

1let Profiler = function(funcName, func) {
2 return function () {
3 let start = new Date().getTime();
4 let returnVal = func.apply(this, arguments);
5 let end = new Date().getTime();
6 let duration = end - start;
7
8 if (Profiler.enabled) {
9 console.log(funcName + '() took ' + duration + 'ms');
10 }
11
12 return returnVal;
13 };
14};
15
16Profiler.enabled = false;
17

Callers 2

WebGL.jsFile · 0.85
VertexBridge.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected