exercises/ex05/time_rand.c
double time_func(int iters, float(*func)())
{
    int i;
    float f;
    double t0, t1;

    srandom(time(NULL));

    t0 = get_seconds();
    for (i=0; i<iters; i++) {
        f = func();
    }
    t1 = get_seconds();
    return t1 - t0;
}
/* Compute the total time used by a function.

iters: number of times to call the function
func: function to call
*/
Compute the total time used by a function.
iters: number of times to call the function
func: function to call
Compute the total time used by a function . iters : number of times to call the function func : function to call
double time_func(int iters, float(*func)())
{
    int i;
    float f;
    double t0, t1;
    srandom(time(NULL));
    t0 = get_seconds();
    for (i=0; i<iters; i++) {
        f = func();
    }
    t1 = get_seconds();
    return t1 - t0;
}
double time_func ( int iters , float ( * func ) ( ) ) { int i ; float f ; double t0 , t1 ; srandom ( time ( NULL ) ) ; t0 = get_seconds ( ) ; for ( i = 0 ; i < iters ; i ++ ) { f = func ( ) ; } t1 = get_seconds ( ) ; return t1 - t0 ; }
Compute the total time used by a function.
Compute the total time used by a function .