def METHOD_NAME(test_func, test_env, test_case, count=5, initial_run=True):
    """Benchmark one test-case
    test_func   -- benchmarking function with prototype
                   test_func(env, case), which takes test_env and test_case
                   arguments and returns {'seconds': int} (which is benchmark
                   result) on success and {'error': str} on error. Returned
                   dict may contain any other additional fields.
    test_env    -- test environment - opaque first argument for test_func
    test_case   -- test case - opaque second argument for test_func
    count       -- how many times to call test_func, to calculate average
    initial_run -- do initial run of test_func, which don't get into result
    Returns dict with the following fields:
        'runs':     list of test_func results
        'average':  average seconds per run (exists only if at least one run
                    succeeded)
        'delta':    maximum delta between test_func result and the average
                    (exists only if at least one run succeeded)
        'n-failed': number of failed runs (exists only if at least one run
                    failed)
    """
    if initial_run:
        print('  #initial run:')
        print('   ', test_func(test_env, test_case))
    runs = []
    for i in range(count):
        print('  #run {}'.format(i+1))
        res = test_func(test_env, test_case)
        print('   ', res)
        runs.append(res)
    result = {'runs': runs}
    successed = [r for r in runs if ('seconds' in r)]
    if successed:
        avg = sum(r['seconds'] for r in successed) / len(successed)
        result['average'] = avg
        result['delta'] = max(abs(r['seconds'] - avg) for r in successed)
    if len(successed) < count:
        result['n-failed'] = count - len(successed)
    return result