Changeset 14069
- Timestamp:
- Jul 8, 2007, 12:18:50 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/CheckTasks.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/CheckTasks.c
r12404 r14069 6 6 Task *task; 7 7 int status; 8 float time_running, next_timeout ;8 float time_running, next_timeout, fuzz; 9 9 // struct timeval now; 10 10 … … 45 45 next_timeout = 0.0; 46 46 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; 48 53 49 54 /* ready to run? : run task.exec macro */
Note:
See TracChangeset
for help on using the changeset viewer.
