Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9343


Ignore:
Timestamp:
04/05/13 23:20:28 (10 years ago)
Author:
abeham
Message:

#1590: changed date difference calculation to use UTC dates to avoid wrong time spans around daylight savings changes

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs

    r8962 r9343  
    327327    private void Run(object state) {
    328328      CancellationToken cancellationToken = (CancellationToken)state;
    329       lastUpdateTime = DateTime.Now;
     329      lastUpdateTime = DateTime.UtcNow;
    330330      System.Timers.Timer timer = new System.Timers.Timer(250);
    331331      timer.AutoReset = true;
     
    352352        timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed);
    353353        timer.Stop();
    354         ExecutionTime += DateTime.Now - lastUpdateTime;
     354        ExecutionTime += DateTime.UtcNow - lastUpdateTime;
    355355      }
    356356    }
     
    359359      System.Timers.Timer timer = (System.Timers.Timer)sender;
    360360      timer.Enabled = false;
    361       DateTime now = DateTime.Now;
     361      DateTime now = DateTime.UtcNow;
    362362      ExecutionTime += now - lastUpdateTime;
    363363      lastUpdateTime = now;
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/FixedDataAnalysisAlgorithm.cs

    r7259 r9343  
    9696    private void Run(object state) {
    9797      CancellationToken cancellationToken = (CancellationToken)state;
    98       lastUpdateTime = DateTime.Now;
     98      lastUpdateTime = DateTime.UtcNow;
    9999      System.Timers.Timer timer = new System.Timers.Timer(250);
    100100      timer.AutoReset = true;
     
    107107        timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed);
    108108        timer.Stop();
    109         ExecutionTime += DateTime.Now - lastUpdateTime;
     109        ExecutionTime += DateTime.UtcNow - lastUpdateTime;
    110110      }
    111111
     
    121121      System.Timers.Timer timer = (System.Timers.Timer)sender;
    122122      timer.Enabled = false;
    123       DateTime now = DateTime.Now;
     123      DateTime now = DateTime.UtcNow;
    124124      ExecutionTime += now - lastUpdateTime;
    125125      lastUpdateTime = now;
  • trunk/sources/HeuristicLab.Core/3.3/Engine.cs

    r7259 r9343  
    145145
    146146      OnStarted();
    147       lastUpdateTime = DateTime.Now;
     147      lastUpdateTime = DateTime.UtcNow;
    148148      System.Timers.Timer timer = new System.Timers.Timer(250);
    149149      timer.AutoReset = true;
     
    156156        timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed);
    157157        timer.Stop();
    158         ExecutionTime += DateTime.Now - lastUpdateTime;
     158        ExecutionTime += DateTime.UtcNow - lastUpdateTime;
    159159      }
    160160
     
    166166      System.Timers.Timer timer = (System.Timers.Timer)sender;
    167167      timer.Enabled = false;
    168       DateTime now = DateTime.Now;
     168      DateTime now = DateTime.UtcNow;
    169169      ExecutionTime += now - lastUpdateTime;
    170170      lastUpdateTime = now;
  • trunk/sources/HeuristicLab.DebugEngine/3.3/DebugEngine.cs

    r7259 r9343  
    155155      cancellationTokenSource = new CancellationTokenSource();
    156156      stopPending = false;
    157       lastUpdateTime = DateTime.Now;
     157      lastUpdateTime = DateTime.UtcNow;
    158158      timer.Start();
    159159      try {
     
    166166      }
    167167      timer.Stop();
    168       ExecutionTime += DateTime.Now - lastUpdateTime;
     168      ExecutionTime += DateTime.UtcNow - lastUpdateTime;
    169169      cancellationTokenSource.Dispose();
    170170      cancellationTokenSource = null;
     
    242242
    243243      OnStarted();
    244       lastUpdateTime = DateTime.Now;
     244      lastUpdateTime = DateTime.UtcNow;
    245245      timer.Start();
    246246      try {
     
    253253      finally {
    254254        timer.Stop();
    255         ExecutionTime += DateTime.Now - lastUpdateTime;
     255        ExecutionTime += DateTime.UtcNow - lastUpdateTime;
    256256
    257257        if (IsAtBreakpoint)
     
    263263      System.Timers.Timer timer = (System.Timers.Timer)sender;
    264264      timer.Enabled = false;
    265       DateTime now = DateTime.Now;
     265      DateTime now = DateTime.UtcNow;
    266266      ExecutionTime += now - lastUpdateTime;
    267267      lastUpdateTime = now;
Note: See TracChangeset for help on using the changeset viewer.