Changeset 4763 for trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
- Timestamp:
- Aug 14, 2005, 10:33:53 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/CheckSystem.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
r4762 r4763 1 1 # include "pcontrol.h" 2 2 3 static Npass = 0;3 static struct timeval lastlive = {0, 0}; 4 4 5 5 int CheckSystem () { 6 7 struct timeval now; 8 float dtime; 6 9 7 10 /* we want to give each block a maximum allowed time */ … … 14 17 CheckDownHosts(0.100); /* launch the host */ 15 18 19 /* always allow at least one test */ 16 20 /* most tests require about 2ms per host. 17 21 CheckDoneJobs must depend on the size of the output buffer */ 18 22 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) { 21 26 CheckLiveHosts(0.040); 22 Npass = 0; 23 } else { 24 Npass ++; 25 } 27 lastlive = now; 28 } 26 29 27 30 if (0) {
Note:
See TracChangeset
for help on using the changeset viewer.
