lmbench timing(3)

NAME
BENCH, BENCH_OVERHEAD, BENCH1, start, stop, get_n, set_n, gettime, settime,
    get_enough, t_overhead, l_overhead - the lmbench timing subsystem

SYNOPSIS
#include ``lmbench.h''

BENCH(loop_body, enough)

BENCH_OVERHEAD(loop_body, overhead_loop, enough) BENCH1(loop_body, enough)

void start(struct timeval *begin)

uint64 stop(struct timeval *begin, struct timeval *end)

uint64 get_n()

void set_n(uint64 n)

uint64 gettime()

void settime(uint64 u)

uint64 get_enough(uint64 enough)

uint64 t_overhead()

double l_overhead()

DESCRIPTION
The single most important element of a good benchmarking system is the quality and reliability of its measurement system. lmbench's timing subsystem manages the experimental timing process to produce accurate results in the least possible time. lmbench includes methods for measuring and eliminating several factors that influence the accuracy of timing measurements, such as the resolution of the system clock.

lmbench gets accurate results by considering clock resolution, auto-sizing the duration of each benchmark, and conducting multiple experiments.

BENCH(loop_body, enough)
    measures the performance of loop_body repeatedly and report the median result.

BENCH_OVERHEAD(loop_body, overhead_loop, enough)
    repeatedly measures the performance of loop_body and subtract the time in overhead_loop and reports the median result.

BENCH1(loop_body, enough)
    measures the performance of loop_body once.

void	start(struct timeval *begin)
    start a timing interval. If begin is non-null, save the start time in begin .

uint64	stop(struct timeval *begin, struct timeval *end)
    stop a timing interval, returning the number of elapsed micro-seconds.

uint64	get_n()
    returns the number of times loop_body was executed during the timing interval.

void	set_n(uint64 n)
    sets the number of times loop_body was executed during the timing interval.

uint64	gettime()
    returns the number of micro-seconds in the timing interval.

void	settime(uint64 u)
    sets the number of micro-seconds in the timing interval.

uint64	get_enough(uint64 enough)
    return the time in micro-seconds needed to accurately measure a timing interval.

uint64	t_overhead()
    return the time in micro-seconds needed to measure time.

double	l_overhead()
    return the time in micro-seconds needed to do a simple loop.

VARIABLES
There are three environment variables that can be used to modify the lmbench timing subsystem: ENOUGH, TIMING_O, and LOOP_O. The environment variables can be used to directly set the results of get_enough , t_overhead , and l_overhead . When running a large number of benchmarks, or repeating the same benchmark many times, this can save time by eliminating the necessity of recalculating these values for each run.

FUTURES
Development of lmbench is continuing.

SEE ALSO
lmbench(8), lmbench(3), reporting(3), results(3).

AUTHOR
Carl Staelin and Larry McVoy

Comments, suggestions, and bug reports are always welcome.