IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 14, 2005, 10:33:53 AM (21 years ago)
Author:
eugene
Message:

cleanup up communications for speed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/CheckSystem.c

    r4762 r4763  
    11# include "pcontrol.h"
    22
    3 static Npass = 0;
     3static struct timeval lastlive = {0, 0};
    44
    55int CheckSystem () {
     6
     7  struct timeval now;
     8  float dtime;
    69
    710  /* we want to give each block a maximum allowed time */
     
    1417  CheckDownHosts(0.100); /* launch the host */
    1518
     19  /* always allow at least one test */
    1620  /* most tests require about 2ms per host. 
    1721     CheckDoneJobs must depend on the size of the output buffer */
    1822
    19   /* this is a waste of cycles: no need to do this every loop */
    20   if (Npass > 20) {
     23  gettimeofday (&now, (void *) NULL);
     24  dtime = DTIME (now, lastlive);
     25  if (dtime > 1.0) {
    2126    CheckLiveHosts(0.040);
    22     Npass = 0;
    23   } else {
    24     Npass ++;
    25   }
     27    lastlive = now;
     28  }
    2629
    2730  if (0) {
Note: See TracChangeset for help on using the changeset viewer.