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.1.1.1 2005/03/22 08:34:24 cmzmasek 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 * HMMER - Biological sequence analysis with profile HMMs
13 * Copyright (C) 1992-1999 Washington University School of Medicine
16 * This source code is distributed under the terms of the
17 * GNU General Public License. See the files COPYING and LICENSE
19 *****************************************************************
23 #ifndef SRE_STRICT_ANSI
24 #include <sys/times.h>
27 #ifndef STOPWATCH_H_INCLUDED
28 #define STOPWATCH_H_INCLUDED
31 time_t t0; /* Wall clock time, ANSI time() */
32 #ifdef SRE_STRICT_ANSI
33 clock_t cpu0; /* CPU time, ANSI clock() */
35 struct tms cpu0; /* CPU/system time, POSIX times()*/
38 double elapsed; /* elapsed time, seconds */
39 double user; /* CPU time, seconds */
40 double sys; /* system time, seconds */
42 typedef struct stopwatch_s Stopwatch_t;
44 extern void StopwatchStart(Stopwatch_t *w);
45 extern void StopwatchStop(Stopwatch_t *w);
46 extern void StopwatchInclude(Stopwatch_t *w1, Stopwatch_t *w2);
47 extern Stopwatch_t *StopwatchCreate(void);
48 extern void StopwatchZero(Stopwatch_t *w);
49 extern void StopwatchCopy(Stopwatch_t *w1, Stopwatch_t *w2);
50 extern void StopwatchFree(Stopwatch_t *w);
51 extern void StopwatchDisplay(FILE *fp, char *s, Stopwatch_t *w);
54 extern void StopwatchPVMPack(Stopwatch_t *w);
55 extern void StopwatchPVMUnpack(Stopwatch_t *w);
58 #endif /*STOPWATCH_H_INCLUDED*/