2 * SRE, Fri Nov 26 14:54:21 1999 [St. Louis] [HMMER]
3 * SRE, Thu Aug 3 08:00:35 2000 [St. Louis] [moved to SQUID]
4 * CVS $Id: stopwatch.h,v 1.2 2000/08/03 22:24:38 eddy Exp)
6 * Header file for stopwatch.c module:
7 * reporting of cpu/system/elapsed time used by a process.
8 * See stopwatch.c comments for documentation of compile-time
9 * configuration options and API.
11 *****************************************************************
12 * SQUID - a library of functions for biological sequence analysis
13 * Copyright (C) 1992-2002 Washington University School of Medicine
15 * This source code is freely distributed under the terms of the
16 * GNU General Public License. See the files COPYRIGHT and LICENSE
18 *****************************************************************
22 #ifndef SRE_STRICT_ANSI
23 #include <sys/times.h>
26 #ifndef STOPWATCH_H_INCLUDED
27 #define STOPWATCH_H_INCLUDED
30 time_t t0; /* Wall clock time, ANSI time() */
31 #ifdef SRE_STRICT_ANSI
32 clock_t cpu0; /* CPU time, ANSI clock() */
34 struct tms cpu0; /* CPU/system time, POSIX times()*/
37 double elapsed; /* elapsed time, seconds */
38 double user; /* CPU time, seconds */
39 double sys; /* system time, seconds */
41 typedef struct stopwatch_s Stopwatch_t;
43 extern void StopwatchStart(Stopwatch_t *w);
44 extern void StopwatchStop(Stopwatch_t *w);
45 extern void StopwatchInclude(Stopwatch_t *w1, Stopwatch_t *w2);
46 extern Stopwatch_t *StopwatchCreate(void);
47 extern void StopwatchZero(Stopwatch_t *w);
48 extern void StopwatchCopy(Stopwatch_t *w1, Stopwatch_t *w2);
49 extern void StopwatchFree(Stopwatch_t *w);
50 extern void StopwatchDisplay(FILE *fp, char *s, Stopwatch_t *w);
53 extern void StopwatchPVMPack(Stopwatch_t *w);
54 extern void StopwatchPVMUnpack(Stopwatch_t *w);
57 #endif /*STOPWATCH_H_INCLUDED*/