IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 13, 2005, 10:30:13 AM (21 years ago)
Author:
eugene
Message:

working on speed issues

File:
1 edited

Legend:

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

    r4714 r4762  
    11# include "psched.h"
     2
     3# define MAX_DELAY 0.1
     4struct timeval start;
     5static int Ncheck = 0;
    26
    37int CheckSystem () {
    48
    5   /* need to make a timeout: if this process lasts too long,
    6      we should return so the user can get input in.  this cannot
    7      just be a return, because we need to hit each of the elements
    8      eventually
    9   */
    10   struct timeval start, stop;
    11   double dtime;
    12  
    139  gettimeofday (&start, (void *) NULL);
    14   CheckTasks ();
     10
     11  if (Ncheck < 5) {
     12    CheckTasks ();
     13    CheckJobs ();
     14    Ncheck ++;
     15  } else {
     16    CheckController ();
     17    CheckControllerOutput ();
     18    Ncheck = 0;
     19  }
     20  return (TRUE);
     21}
     22
     23int TestElapsedCheck () {
     24
     25  struct timeval stop;
     26  float dtime;
     27
    1528  gettimeofday (&stop, (void *) NULL);
    1629  dtime = DTIME (stop, start);
    17   if (VerboseMode()) fprintf (stderr, "check 1: %f seconds\n", dtime);
     30  if (dtime > MAX_DELAY) return (TRUE);
     31  return (FALSE);
     32}
    1833
    19   gettimeofday (&start, (void *) NULL);
    20   CheckJobs ();
    21   gettimeofday (&stop, (void *) NULL);
    22   dtime = DTIME (stop, start);
    23   if (VerboseMode()) fprintf (stderr, "check 2: %f seconds\n", dtime);
    24 
    25   gettimeofday (&start, (void *) NULL);
    26   CheckController ();
    27   gettimeofday (&stop, (void *) NULL);
    28   dtime = DTIME (stop, start);
    29   if (VerboseMode()) fprintf (stderr, "check 3: %f seconds\n", dtime);
    30 
    31   gettimeofday (&start, (void *) NULL);
    32   CheckControllerOutput ();
    33   gettimeofday (&stop, (void *) NULL);
    34   dtime = DTIME (stop, start);
    35   if (VerboseMode()) fprintf (stderr, "check 4: %f seconds\n", dtime);
    36 
    37   return (TRUE);
    38 }
     34  /* do we really need to check the controller on every call?
     35     or perhaps alternate?
     36  */
Note: See TracChangeset for help on using the changeset viewer.