public void pait() { Stopwatch timerPosl = new Stopwatch(); Stopwatch timerParall = new Stopwatch(); double n = 10000; int kol = 7; integral integ = new integral(); (graph3.Model.Series[0] as BarSeries).Items.Clear(); for (int k = 0; k < kol; k++) { timerPosl.Start(); integ.calculatePosl(n); timerPosl.Stop(); timerParall.Start(); integ.calculateParallel(n); timerParall.Stop(); (graph3.Model.Series[0] as BarSeries).Items.Add(new BarItem(timerPosl.ElapsedMilliseconds)); (graph3.Model.Series[1] as BarSeries).Items.Add(new BarItem(timerParall.ElapsedMilliseconds)); timerParall.Reset(); timerPosl.Reset(); n *= 2; } graph3.InvalidatePlot(); }
public void Calc() { // (graph1.Model.Series[0] as LineSeries).Points.Clear(); Stopwatch st = new Stopwatch(); integral integ = new integral(); int n = Convert.ToInt32(this.nText.Text); double rez = 0; if (sposob.SelectedIndex == 0) { st.Start(); rez = integ.calculatePosl(n); st.Stop(); } else { st.Start(); rez = integ.calculateParallel(n); st.Stop(); } double time = (double)st.ElapsedMilliseconds; // (graph1.Model.Series[0] as LineSeries).Points.Add(new DataPoint(time, n)); this.resultText.Text = Convert.ToString(rez); this.timeText.Text = Convert.ToString(time) + " mс"; st.Reset(); // graph1.InvalidatePlot(); }
public void culc() { (graph1.Model.Series[0] as LineSeries).Points.Clear(); Stopwatch timer = new Stopwatch(); double n = 1000; int kol = 10; integral integ = new integral(); for (int k = 0; k < kol; k++) { timer.Start(); integ.calculatePosl(n); timer.Stop(); (graph1.Model.Series[0] as LineSeries).Points.Add(new DataPoint(timer.ElapsedMilliseconds, n)); timer.Reset(); n *= 2; } graph1.InvalidatePlot(); }