function compute
compute(
groups: string[][],
weights: Map<string, number>,
wallTimes: Map<number, number>
): Map<string, number>

Distributes each group's wall-clock ms to its files proportionally by LPT weight.

import * as Timings from './timings.ts';

const weights = new Map([['/a.ts', 300], ['/b.ts', 100]]);
const times = Timings.compute([['/a.ts', '/b.ts']], weights, new Map([[0, 800]]));
times.get('/a.ts'); // 600 — group 0's 800ms split 3:1 by weight

Parameters

groups: string[][]
weights: Map<string, number>
wallTimes: Map<number, number>

Return Type

Map<string, number>

Usage

import { compute } from "lib/commands/test/timings.ts";