Add README
[xapian-trec.git] / timer.h
blob706a25c9e09f00caf7b19e1003cbcf519e0daf2b
1 /* File: timer.h
2 Date: 9 December 1996
3 Description: timing library routines
4 Copyright: A. MacFarlane (1996)
5 Altered 27/2/2007 for terabtye web efficiency experiments
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation.
11 This program is distributed in the hope that it will be useful
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <sys/types.h>
23 #include <sys/time.h>
24 #include "timerstruct.h" /* timer data structures */
27 extern void diff_time( struct timeval finish,
28 struct timeval start,
29 struct timeval *cost );
30 /* calculate the difference in time between start and finish (in whole and
31 decimal parts) */
33 extern void accumtime( struct timeval *current,
34 struct timeval newv );
35 /* accumulate time from new into current */
37 extern void accumcost( COST *cur_cost, COST new_cost );
38 /* accumulate costs form new in cur */
40 extern void Init_Cost( COST *cost );
41 /* initialise cost structure */
43 extern void Disp_Time( struct timeval timebefore, struct timeval timeafter );
44 /* display the time lapse between before and after */
46 extern void Print_Costs( COST costs );
47 /* print cost information to standard error */
49 extern float time_real( struct timeval t );
50 /* convert struct timeval into a real time in one figure */