protected BaseProfilingOperation() { Results = new ProfilingResults(); Messanger = new NamedPipeMessanger(); Action <string> changeStatus = x => Workspace.Instance.Status.Status = x; Messanger.MessageRecived += x => { if (Application.Current != null) { Application.Current.Dispatcher.Invoke(changeStatus, x); } else { changeStatus(x); } }; Messanger.SpecificMessageRecived += SpecificMessageRecived; }
public void ExecuteRun() { Thread.Sleep(100); Console.WriteLine("Testset '" + name + "', run " + (measurements.Count + 1)); Stopwatch watch = new Stopwatch(); watch.Start(); ProfilingResults results = runTestSet(); watch.Stop(); List <string> content = new List <string>(); content.Add("Total external time: " + FormatTime(watch.Elapsed.TotalMilliseconds)); foreach (var field in typeof(ProfilingResults).GetFields()) { string value = field.GetValue(results) as string; if (value != null) { content.Add(field.Name + ": " + value); } } content.ForEach(Console.WriteLine); measurements.Add(File.ReadAllLines("benchmark.out").Concat(content).Select(line => Measurement.Parse(line)).ToList()); }