ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdisp.c
(Generate patch)

Comparing ray/src/hd/rhdisp.c (file contents):
Revision 3.20 by gregl, Sun Jan 4 18:37:10 1998 UTC vs.
Revision 3.21 by gregl, Mon Jan 5 17:40:28 1998 UTC

# Line 30 | Line 30 | char   *progname;              /* global argv[0] */
30  
31   FILE    *sstdin, *sstdout;      /* server's standard input and output */
32  
33 + #ifdef DEBUG
34 + #include <sys/types.h>
35 + extern time_t   time();
36 + static time_t   tmodesw;
37 + static time_t   timm, tadd;
38 + static long     nimmrays, naddrays;
39 + #endif
40 +
41   #define RDY_SRV         01
42   #define RDY_DEV         02
43   #define RDY_SIN         04
# Line 55 | Line 63 | char   *argv[];
63                  sstdin = fdopen(inp, "r");
64                                          /* set command error vector */
65          erract[COMMAND].pf = eputs;
66 + #ifdef DEBUG
67 +        tmodesw = time(NULL);
68 + #endif
69                                          /* enter main loop */
70          do {
71                  rdy = disp_wait();
# Line 110 | Line 121 | char   *argv[];
121                                  break;
122                          }
123          } while (res != DS_SHUTDOWN);
124 + #ifdef DEBUG
125 +        if (timm && nimmrays)
126 +                fprintf(stderr,
127 +                        "%s: %.1f rays recalled/second (%ld rays total)\n",
128 +                                progname, (double)nimmrays/timm, nimmrays);
129 +        if (tadd && naddrays)
130 +                fprintf(stderr,
131 +                        "%s: %.1f rays calculated/second (%ld rays total)\n",
132 +                                progname, (double)naddrays/tadd, naddrays);
133 + #endif
134                                          /* all done */
135          quit(0);
136   }
# Line 212 | Line 233 | register PACKHEAD      *p;
233                  VSUM(wp, ro, rd, d);            /* might be behind viewpoint */
234                  dev_value(packra(p)[i].v, wp, rd);
235          }
236 + #ifdef DEBUG
237 +        if (imm_mode) nimmrays += p->nr;
238 +        else naddrays += p->nr;
239 + #endif
240   }
241  
242  
# Line 366 | Line 391 | serv_result()                  /* get next server result and process
391                  break;
392          case DS_STARTIMM:
393          case DS_ENDIMM:
394 + #ifdef DEBUG
395 +                if (imm_mode != (msg.type==DS_STARTIMM)) {
396 +                        time_t  tnow = time(NULL);
397 +                        if (imm_mode) timm += tnow - tmodesw;
398 +                        else tadd += tnow - tmodesw;
399 +                        tmodesw = tnow;
400 +                }
401 + #endif
402                  imm_mode = msg.type==DS_STARTIMM;
403                  /* fall through */
404          case DS_ACKNOW:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines