initial commit
[jalview.git] / forester / archive / RIO / others / hmmer / squid / stopwatch.h
1 /* stopwatch.h
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 $
5  * 
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.
10  * 
11  *****************************************************************
12  * HMMER - Biological sequence analysis with profile HMMs
13  * Copyright (C) 1992-1999 Washington University School of Medicine
14  * All Rights Reserved
15  * 
16  *     This source code is distributed under the terms of the
17  *     GNU General Public License. See the files COPYING and LICENSE
18  *     for details.
19  ***************************************************************** 
20  */
21 #include <stdio.h>
22 #include <time.h>
23 #ifndef SRE_STRICT_ANSI
24 #include <sys/times.h>
25 #endif
26
27 #ifndef STOPWATCH_H_INCLUDED
28 #define STOPWATCH_H_INCLUDED
29
30 struct stopwatch_s {
31   time_t t0;                    /* Wall clock time, ANSI time()  */
32 #ifdef SRE_STRICT_ANSI
33   clock_t cpu0;                 /* CPU time, ANSI clock()        */
34 #else
35   struct tms cpu0;              /* CPU/system time, POSIX times()*/
36 #endif
37
38   double elapsed;               /* elapsed time, seconds */
39   double user;                  /* CPU time, seconds */
40   double sys;                   /* system time, seconds */
41 }; 
42 typedef struct stopwatch_s Stopwatch_t;
43
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);
52
53 #ifdef HMMER_PVM
54 extern void StopwatchPVMPack(Stopwatch_t *w);
55 extern void StopwatchPVMUnpack(Stopwatch_t *w);
56 #endif
57
58 #endif /*STOPWATCH_H_INCLUDED*/
59