Free cookie consent management tool by TermsFeed Policy Generator

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

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

File:
1 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;
Note: See TracChangeset for help on using the changeset viewer.