/* Timing tools */ /****************************************************************************/ /* (C) Copyright 1993 Universidade Estadual de Campinas (UNICAMP) */ /* Campinas, SP, Brazil */ /* */ /* This file can be freely distributed, modified, and used for any */ /* non-commercial purpose, provided that this copyright and authorship */ /* notice be included in any copy or derived version of this file. */ /* */ /* DISCLAIMER: This software is offered ``as is'', without any guarantee */ /* as to fitness for any particular purpose. Neither the copyright */ /* holder nor the authors or their employers can be held responsible for */ /* any damages that may result from its use. */ /****************************************************************************/ #ifndef TIMEFUNC_H #define TIMEFUNC_H void time_func (char *title, int(*func)(int ntimes), int ntimes); /* Calls $func(ntimes)$, and prints a summary of the user times spent in it. Assumes that $func$ contains a loop from 0 to ntimes-1, whose body contains one or more calls the operation actually to be timed. The $func$ procedure should return the actual number of calls made to that operation. */ #endif