(label = "default")
| 183 | delete timers[label]; |
| 184 | }, |
| 185 | timeLog(label = "default") { |
| 186 | originalConsole.timeLog(label); |
| 187 | if (typeof label !== "string") { |
| 188 | throw new TypeError("label must be a string"); |
| 189 | } |
| 190 | if (!timers[label]) { |
| 191 | throw new Error(`No such label: ${label}`); |
| 192 | } |
| 193 | const time = new Date().getTime() - timers[label]; |
| 194 | log("log", getStack(new Error()), `${label}: ${time}ms`); |
| 195 | }, |
| 196 | trace(...args) { |
| 197 | originalConsole.trace(...args); |
| 198 | log("trace", getStack(new Error()), ...args); |