import time


def bench_from_sample( distribution, sample, n=1000 ):
	"""Bench the training of a probability distribution."""

	tic = time.time()
	for i in range(n):
		distribution.summarize( sample )
	return time.time() - tic