UNPKG

@blade47/semantic-test

Version:

A composable, pipeline-based testing framework for AI systems and APIs with semantic validation

23 lines (21 loc) 370 B
/** * Timing utilities */ /** * Measure the execution time of an async function */ export async function measureTime(fn) { const startTime = Date.now(); try { const result = await fn(); return { result, duration: Date.now() - startTime }; } catch (error) { return { error, duration: Date.now() - startTime }; } }