Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5240


Ignore:
Timestamp:
01/08/11 05:35:58 (14 years ago)
Author:
swagner
Message:

Corrected execution time updating in engines (#1367)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Engine.cs

    r5193 r5240  
    147147      OnStarted();
    148148      lastUpdateTime = DateTime.Now;
    149       System.Timers.Timer timer = new System.Timers.Timer(100);
     149      System.Timers.Timer timer = new System.Timers.Timer(250);
    150150      timer.AutoReset = true;
    151151      timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
     
    165165
    166166    private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) {
     167      System.Timers.Timer timer = (System.Timers.Timer)sender;
     168      timer.Enabled = false;
    167169      DateTime now = DateTime.Now;
    168170      ExecutionTime += now - lastUpdateTime;
    169171      lastUpdateTime = now;
     172      timer.Enabled = true;
    170173    }
    171174  }
  • trunk/sources/HeuristicLab.DebugEngine/3.3/DebugEngine.cs

    r5193 r5240  
    6464
    6565    private void InitializeTimer() {
    66       timer = new System.Timers.Timer(100);
     66      timer = new System.Timers.Timer(250);
    6767      timer.AutoReset = true;
    6868      timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
     
    261261
    262262    private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) {
     263      System.Timers.Timer timer = (System.Timers.Timer)sender;
     264      timer.Enabled = false;
    263265      DateTime now = DateTime.Now;
    264266      ExecutionTime += now - lastUpdateTime;
    265267      lastUpdateTime = now;
     268      timer.Enabled = true;
    266269    }
    267270    #endregion
Note: See TracChangeset for help on using the changeset viewer.