export async function stopwatch(promise: Promise) { const start = Date.now() const result = await promise const time = Date.now() - start return [time, result] }