(ts, runTaskEnd)
| 666 | |
| 667 | // Find the next event start after ts within the same RunTask |
| 668 | function nextEventStartInRunTask(ts, runTaskEnd) { |
| 669 | // Binary search for first event start > ts |
| 670 | let lo = 0; let |
| 671 | hi = nonRunTaskEventStarts.length; |
| 672 | |
| 673 | while (lo < hi) { |
| 674 | const mid = Math.floor((lo + hi) / 2); |
| 675 | |
| 676 | if (nonRunTaskEventStarts[mid] <= ts) { |
| 677 | lo = mid + 1; |
| 678 | } else { |
| 679 | hi = mid; |
| 680 | } |
| 681 | } |
| 682 | // lo is the index of the first event start > ts |
| 683 | if (lo < nonRunTaskEventStarts.length && nonRunTaskEventStarts[lo] < runTaskEnd) { |
| 684 | return nonRunTaskEventStarts[lo]; |
| 685 | } |
| 686 | |
| 687 | return runTaskEnd; |
| 688 | } |
| 689 | |
| 690 | // Find RunTask end for a given timestamp |
| 691 | function getRunTaskEnd(ts) { |
no outgoing calls
no test coverage detected
searching dependent graphs…