Opened 7 years ago
Last modified 6 years ago
#2869 new enhancement
Change measurement of execution time
Reported by: | abeham | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | HeuristicLab 3.3.17 |
Component: | Optimization | Version: | branch |
Keywords: | Cc: |
Description
Execution time is measured via a System.Timer that basically runs in a thread of its own. This has several drawbacks:
- The thread is created even in the case where no GUI exists and Execution Time updating is not of interest
- The execution time is only updated at a fixed interval of currently 200ms
I propose to change measuring execution time by recording a start date and some elapsed time. The execution time is then a sum of the time since it was started and the elapsed time.
Attachments (1)
Change History (6)
Changed 7 years ago by abeham
comment:1 Changed 7 years ago by abeham
There are some notable issues when implementing this feature:
- We must use UtcTime to avoid daylight saving issues
- We must not use Stop() or Pause() methods, but rather OnStopped() and OnPaused()
- Going from Paused to Stop must not increment the execution time
- The TimeLimitRun that relies on ExecutionTimeChanged must implement its own timer
- ExecutionTimeChanged must disappear from the respective interfaces
- All views tracking execution time must implement a timer
- OnStopped() changes an algorithm's executionState in the base class (in the patch it's done right for BasicAlgorithm and wrong for HeuristicOptimizationAlgorithm)
- Engines need to be adapted as well
comment:2 Changed 7 years ago by abeham
Revision r15603 implements this feature in another branch
comment:3 Changed 7 years ago by abeham
- Version set to branch
comment:4 Changed 7 years ago by abeham
Unfortunately, DateTime proved to be only a very rough estimate for measuring execution time. The startDate should be replaced with an instance of the Stopwatch class.
comment:5 Changed 6 years ago by abeham
- Milestone changed from HeuristicLab 3.3.16 to HeuristicLab 3.3.17
A patch that updates classes in HeuristicLab.Optimization