00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef lint
00032 static const char RCShep[] = "@(#)$Header: /cvsroot/brlcad/brlcad/src/librt/timerhep.c,v 14.9 2006/09/16 02:04:26 lbutler Exp $ (BRL)";
00033 #endif
00034
00035 #include <stdio.h>
00036
00037
00038 extern long time(time_t *);
00039 static long time0;
00040
00041
00042
00043
00044
00045 void
00046 rt_prep_timer(void)
00047 {
00048 (void)time(&time0);
00049 (void)intime_();
00050 }
00051
00052
00053
00054
00055
00056
00057 double
00058 rt_read_timer(char *str, int len)
00059 {
00060 long now;
00061 double usert;
00062 long htime[6];
00063 char line[132];
00064
00065 (void)stats_(htime);
00066 (void)time(&now);
00067 usert = ((double)htime[0]) / 10000000.0;
00068 if( usert < 0.00001 ) usert = 0.00001;
00069 sprintf(line,"%f secs: %ld wave, %ld fp, %ld dmem, %ld other",
00070 usert,
00071 htime[0], htime[1], htime[2], htime[3], htime[4] );
00072 (void)strncpy( str, line, len );
00073 return( usert );
00074 }
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085