bmw_util - Benchmarking Utilities
#include <stdio.h> -- Standard I/O definitions.
#include "bmw_util.h" -- Benchmarking definitions.
int main (int argc, char *argv[])
{
BmwClock clock ;
int i, num_lines ;
num_lines = atoi (argv[1]) ;
bmwStart (&clock) ;
for (i = 0 ; i < num_lines ; i++)
printf ("Hello, World!\n") ;
bmwStop (&clock) ;
printf ("%g lines per second.\n",
bmwRate (&clock, (long) num_lines)) ;
}
bmwElapsed() - returns the elapsed time for a timer.
bmwRate() - computes the rate (# of X per second) for a timer.
bmwStart() - starts a timer.
bmwStop() - stops a timer.
bmw_util.c
bmw_util.h
(See libgpl for the
complete source, including support routines and build files.)