'Call func(*args, **kw) as many times as needed to get
good statistics. Algorithm:
- call the function once
- compute needed number of calls
- and then call function N times
To compute number of calls, parameters are:
- time of first function call
- minimum number of calls (min_count attribute)
- maximum test time (max_time attribute)
Notice: The function will approximate number of calls.'

def _run(self, func, args, kw):

    stat = BenchmarkStat()
    diff = self._runOnce(func, args, kw)
    best = diff
    stat.append(diff)
    total_time = diff
    count = int(floor((self.max_time / diff)))
    count = max(count, self.min_count)
    if self.max_count:
        count = min(count, self.max_count)
    if (count == 1):
        return stat
    estimate = (diff * count)
    if self.verbose:
        print (_('Run    benchmark:    %s    calls    (estimate:    %s)') % (count, self.formatTime(estimate)))
    display_progress = (self.verbose and (1.0 <= estimate))
    total_count = 1
    while (total_count < count):
        if display_progress:
            print (_('Result    %s/%s:    %s        (best:    %s)') % (total_count, count, self.formatTime(diff), self.formatTime(best)))
        part = (count - total_count)
        average = (total_time / total_count)
        if (self.progress_time < (part * average)):
            part = max(int((self.progress_time / average)), 1)
        for index in xrange(part):
            diff = self._runOnce(func, args, kw)
            stat.append(diff)
            total_time += diff
            best = min(diff, best)
        total_count += part
    if display_progress:
        print (_('Result    %s/%s:    %s        (best:    %s)') % (count, count, self.formatTime(diff), self.formatTime(best)))
    return stat
