(funcName, func)
| 1 | let 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 | |
| 16 | Profiler.enabled = false; |
| 17 |
no outgoing calls
no test coverage detected