Mac binaries
[jabaws.git] / website / archive / binaries / mac / src / fasta34 / htime.c
1 /* Concurrent read version */
2
3 /* $Name: fa_34_26_5 $ - $Id: htime.c,v 1.3 2006/04/12 18:00:02 wrp Exp $ */
4
5 #include <stdio.h>
6 #include <time.h>
7
8 #ifdef UNIX
9 #include <sys/types.h>
10 #include <sys/time.h>
11 #ifdef TIMES
12 #include <sys/times.h>
13 #else
14 #undef TIMES
15 #endif
16 #endif
17
18 #ifndef HZ
19 #define HZ 100
20 #endif
21
22 time_t s_time ()                        /* returns time in milliseconds */
23 {
24 #ifndef TIMES
25         time_t time(), tt;
26         return time(&tt)*1000;
27 #else
28   struct tms tt;
29   times(&tt);
30 #ifdef CLK_TCK
31   return tt.tms_utime*1000/CLK_TCK;
32 #else
33   return tt.tms_utime*1000/HZ;
34 #endif
35 #endif
36 }
37
38 void ptime (FILE *fp, time_t time)              /* prints the time */
39 {
40   fprintf (fp, "%6.3f",(double)(time)/1000.0);
41 }
42