(tree)
| 298 | } |
| 299 | |
| 300 | function totalTime(tree) { |
| 301 | let totalTime = 0; |
| 302 | let nodeItr; |
| 303 | let node; |
| 304 | let statName; |
| 305 | let statValue; |
| 306 | let statsItr; |
| 307 | let nextNode; |
| 308 | let nextStat; |
| 309 | |
| 310 | for (nodeItr = tree.dfsIterator(); ; ) { |
| 311 | nextNode = nodeItr.next(); |
| 312 | if (nextNode.done) { |
| 313 | break; |
| 314 | } |
| 315 | |
| 316 | node = nextNode.value; |
| 317 | |
| 318 | for (statsItr = node.statsIterator(); ; ) { |
| 319 | nextStat = statsItr.next(); |
| 320 | if (nextStat.done) { |
| 321 | break; |
| 322 | } |
| 323 | |
| 324 | statName = nextStat.value[0]; |
| 325 | statValue = nextStat.value[1]; |
| 326 | |
| 327 | if (statName === 'time.self') { |
| 328 | totalTime += statValue; |
| 329 | } |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | return totalTime; |
| 334 | } |
| 335 | |
| 336 | // exported for testing |
| 337 | Instrumentation._enableFSMonitorIfInstrumentationEnabled = _enableFSMonitorIfInstrumentationEnabled; |
no outgoing calls
no test coverage detected
searching dependent graphs…