IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14069


Ignore:
Timestamp:
Jul 8, 2007, 12:18:50 PM (19 years ago)
Author:
eugene
Message:

added in fuzz to next start time

File:
1 edited

Legend:

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

    r12404 r14069  
    66  Task *task;
    77  int status;
    8   float time_running, next_timeout;
     8  float time_running, next_timeout, fuzz;
    99  // struct timeval now;
    1010
     
    4545    next_timeout = 0.0;
    4646    gettimeofday (&task[0].last, (void *) NULL);
    47     // XXX here is where I should add a fuzz factor (fraction of exec_period)
     47
     48    // add random offset between 0 and 5% of exec_period
     49    // XXX this should be optional
     50    fuzz = 0.05*task[0].exec_period*drand48() + 1e-6*task[0].last.tv_usec;
     51    task[0].last.tv_usec = 1e6*(fuzz - (int)fuzz);
     52    task[0].last.tv_sec += (int) fuzz;
    4853
    4954    /* ready to run? : run task.exec macro */
Note: See TracChangeset for help on using the changeset viewer.