Avena Webapp API - v0.0.1
    Preparing search index...

    Function calculateSourceSampleTimestamps

    • Calculates the time of every value in a scan batch.

      The time of values[i] is firstSampleUnixNs + i * sampleIntervalNs, computed in bigint and then converted to milliseconds.

      Parameters

      • firstSampleUnixNs: bigint

        Time of values[0], Unix epoch, in nanoseconds.

      • sampleIntervalNs: bigint

        Time between consecutive values, in nanoseconds.

      • valueCount: number

        Number of values in the batch.

      Returns number[]

      Unix epoch times in milliseconds (with fractions), one per value, or an empty array if valueCount is not a positive finite number.

      const times = calculateSourceSampleTimestamps(
      scan.firstSampleUnixNs, scan.sampleIntervalNs, scan.values.length);