Chalkboard - v3.0.4
    Preparing search index...

    Function closestIndex

    • Returns the index of the time grid closest to a target time.

      Parameters

      • t: number[]

        Time array.

      • target: number

        Target time.

      Returns number

      const result = Chalkboard.diff.closestIndex([0, 0.5, 1, 1.5], 0.9); // Returns 2