MCPcopy Create free account
hub / github.com/nodejs/node / sortFromId

Method sortFromId

deps/v8/tools/profview/profview.js:550–577  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

548 }
549
550 sortFromId(id) {
551 switch (id) {
552 case "time":
553 return (c1, c2) => {
554 if (c1.ticks < c2.ticks) return 1;
555 else if (c1.ticks > c2.ticks) return -1;
556 return c2.ownTicks - c1.ownTicks;
557 };
558 case "own-time":
559 return (c1, c2) => {
560 if (c1.ownTicks < c2.ownTicks) return 1;
561 else if (c1.ownTicks > c2.ownTicks) return -1;
562 return c2.ticks - c1.ticks;
563 };
564 case "category-time":
565 return (c1, c2) => {
566 if (c1.type === c2.type) return c2.ticks - c1.ticks;
567 if (c1.type < c2.type) return 1;
568 return -1;
569 };
570 case "category-own-time":
571 return (c1, c2) => {
572 if (c1.type === c2.type) return c2.ownTicks - c1.ownTicks;
573 if (c1.type < c2.type) return 1;
574 return -1;
575 };
576 }
577 }
578
579 expandTree(tree, indent) {
580 let index = 0;

Callers 1

expandTreeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected