Changeset 15145


Ignore:
Timestamp:
03/25/13 09:28:52 (9 years ago)
Author:
tbretz
Message:
Replaced blocking while by v8.timeout.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/CheckUnderflow.js

    r15136 r15145  
    9797    v8.sleep(1000); // Let 'timeout' in SendRawData pass
    9898
    99     var event_counter = service_event.get(5000, false).counter;
     99    var event_counter = service_event.get(10000, false).counter;
    100100
    101101    console.out("Starting drs-gain");
     
    105105
    106106    var d = new Date();
    107     //v8.timeout(10000, function() { if (service_event.get(0, false).counter>event_counter) return true; });
    108     while (service_event.get(0, false).counter<=event_counter)
    109         v8.sleep();
     107    v8.timeout(10000, function() { if (service_event.get(0, false).counter>event_counter) return true; });
     108    //while (service_event.get(0, false).counter<=event_counter)
     109    //    v8.sleep();
    110110
    111111    console.out("Event received: "+(new Date()-d)+"ms");
     
    136136        var drs_counter = service_drs.get(0, false).counter;
    137137        dim.send("FAD_CONTROL/LOAD_DRS_CALIBRATION", filefmt.$(yy, mm, dd, yy, mm, dd, nn));
    138         //v8.timeout(5000, function() { if (service_drs.get(0, false).counter>drs_counter) return true; });
    139         while (drs_counter == service_drs.get(0, false).counter)
    140             v8.sleep();
     138
     139        var now = new Date();
     140        v8.timeout(3000, function() { if (service_drs.get(0, false).counter>drs_counter) return true; });
     141        //while (drs_counter == service_drs.get(0, false).counter)
     142        //    v8.sleep();
     143        console.out("Last DRS calibration restored ["+(new Date()-now)/1000+"s]");
    141144    }
    142145
Note: See TracChangeset for help on using the changeset viewer.