import { isIterable } from "@thi.ng/checks/is-iterable" ; import type { Reducer , Transducer } from "./api.js" ; import { compR } from "./compr.js" ; import { iterator1 } from "./iterator.js" ; example export function benchmark ( ) ; export function benchmark ( src ) ; export function benchmark ( src ? ) { return isIterable ( src ) ? iterator1 ( benchmark ( ) , src ) : ( rfn ) => { const r = rfn [ 2 ] ; let prev = Date . now ( ) ; return compR ( rfn , ( acc , _ ) => { const t = Date . now ( ) ; const x = t - prev ; prev = t ; return r ( acc , x ) ; } ) ; } ; }