private void Trainingtimer_Tick(object sender, EventArgs e) { if (progressDialog != null && trainingPromise != null) { var timespan = (DateTime.Now - trainingStart); string time = new TimeSpan(timespan.Hours, timespan.Minutes, timespan.Seconds).ToString(); progressDialog.UpdateResult(trainingPromise.GetTotalProgress(), trainingPromise.IsReady(), "Training... Epochs done: " + trainingPromise.GetEpochsDone(), time); if (trainingPromise.IsReady()) { trainingPromise = null; progressDialog = null; trainingtimer.Stop(); } } }
void timer_Tick(object sender, EventArgs e) { if (trainingPromise.IsReady()) { this.Close(); } ++ticks; long elapsedTotalSeconds = (ticks * (long)updateInterval) / 1000L; int dispMinutes = (int)(elapsedTotalSeconds / 60L); int dispSeconds = (int)(elapsedTotalSeconds % 60L); int percentageDone = (int)(trainingPromise.GetTotalProgress() * 100.0f); progressBar.Value = trainingPromise.GetTotalProgress() * 100.0f; lblDisp.Content = "Epochs done: " + trainingPromise.GetEpochsDone() + " (" + percentageDone + "%) Time elapsed: " + dispMinutes + ":" + dispSeconds.ToString("00"); }
private void timer1_Tick(object sender, EventArgs e) { if (trainingPromise != null) { label4.Text = "Epocs: " + trainingPromise.GetEpochsDone(); progressBar1.Value = (int)(trainingPromise.GetTotalProgress() * 100.0f); if (trainingPromise.IsReady()) { var period = DateTime.Now.Subtract(trainingBegin); label2.Text = "Training done in " + period.TotalSeconds + "s"; timer1.Stop(); } } else { timer1.Stop(); } }