Home / Function/ compareTime() — react Function Reference

compareTime() — react Function Reference

Architecture documentation for the compareTime() function in InspectedElementSuspendedBy.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  52d9869e_7466_4417_c702_6f03d89d5e35["compareTime()"]
  72d570aa_3875_3688_0200_4617e04d04ed["InspectedElementSuspendedBy.js"]
  52d9869e_7466_4417_c702_6f03d89d5e35 -->|defined in| 72d570aa_3875_3688_0200_4617e04d04ed
  style 52d9869e_7466_4417_c702_6f03d89d5e35 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js lines 327–343

function compareTime(
  a: {
    index: number,
    value: SerializedAsyncInfo,
  },
  b: {
    index: number,
    value: SerializedAsyncInfo,
  },
): number {
  const ioA = a.value.awaited;
  const ioB = b.value.awaited;
  if (ioA.start === ioB.start) {
    return ioA.end - ioB.end;
  }
  return ioA.start - ioB.start;
}

Domain

Subdomains

Frequently Asked Questions

What does compareTime() do?
compareTime() is a function in the react codebase, defined in packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js.
Where is compareTime() defined?
compareTime() is defined in packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js at line 327.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free