public PartialViewResult ShowChartSms(string Service, string Type, DateTime DateFirst, DateTime DateLast) { foreach (var select in dataInList.ParseSelectInList(Service, Type, DateFirst, DateLast)) { resultSelectInList.Add(new SpecificationList { Service = select.Service, Type = select.Type, Date = select.Date, Operator = select.Operator, Number = select.Number, Time = select.Time, Duration = select.Duration }); } TotalTime totalTime = new TotalTime(resultSelectInList); totalTime.SummarizeDurationPercentOperator(); ViewBag.DurationSms = new double[5]; ViewBag.PercentDurationSms = new double[5]; for (int i = 0; i < 5; i++) { ViewBag.DurationSms[i] = totalTime.durationEachOperatorSms[i]; ViewBag.PercentDurationSms[i] = totalTime.percentDurationEachOperatorSms[i]; } ViewBag.DateFirst = DateFirst; ViewBag.DateLast = DateLast; ViewBag.Service = Service; ViewBag.Type = Type; return(PartialView()); }
protected override void StopProcessing() { TotalTime.Stop(); WriteObject($"Process Interrupted - total time: {TotalTime.Elapsed.Seconds} seg"); base.StopProcessing(); }
protected override void EndProcessing() { TotalTime.Stop(); WriteObject($"Finished, total time: {TotalTime.Elapsed.Seconds} seg - Speed {Mean / (double)CObject.Files.Length} sec/picture"); base.EndProcessing(); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (PrepTime != null) { hashCode = hashCode * 59 + PrepTime.GetHashCode(); } if (TotalTime != null) { hashCode = hashCode * 59 + TotalTime.GetHashCode(); } if (Servings != null) { hashCode = hashCode * 59 + Servings.GetHashCode(); } if (ServingSize != null) { hashCode = hashCode * 59 + ServingSize.GetHashCode(); } return(hashCode); } }
/// <summary> /// Called by the Loader, once when the library is loaded. /// </summary> /// <param name="logFile">Where to write log output</param> public static void OnInit(TextWriter logFile) { LogFile = logFile; TotalTime.Start(); GameVersion = (VersionNum)GetGameVersion(); Log($"Initializing game version {GameVersion}..."); // Create all the scripts first so they can order themselves, using their DependsOn attribute Assembly.GetExecutingAssembly().GetTypes().Each(CreateScript); Log("Script Order: " + string.Join(" ", Script.Order.Select(s => s.GetType().Name.Split('.').Last()))); // Then use OnInit() on each of them in their preferred order. // Loop using manual LinkedList methods so we can use RemoveAndContinue LinkedListNode <Script> cur = Script.Order.First; while (cur != null && cur.Value != null) { try { cur.Value.OnInit(); cur = cur.Next; } catch (Exception err) { Log($"Failed to init {cur.Value.GetType().Name}: {err.Message}"); Log(err.StackTrace); Log(err.InnerException?.ToString()); cur = Script.Order.RemoveAndContinue(cur); } } Controls.OnInit(); }
/// <summary> /// Returns true if RecipeObjectAttributes instances are equal /// </summary> /// <param name="other">Instance of RecipeObjectAttributes to be compared</param> /// <returns>Boolean</returns> public bool Equals(RecipeObjectAttributes other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( PrepTime == other.PrepTime || PrepTime != null && PrepTime.Equals(other.PrepTime) ) && ( TotalTime == other.TotalTime || TotalTime != null && TotalTime.Equals(other.TotalTime) ) && ( Servings == other.Servings || Servings != null && Servings.Equals(other.Servings) ) && ( ServingSize == other.ServingSize || ServingSize != null && ServingSize.Equals(other.ServingSize) )); }
public void Clear() { TotalTime.Reset(); foreach (var stopwatch in GoalTime) { stopwatch.Reset(); } }
private string Status() { if (!Failed) { return(TotalTime.ToString("F3")); } return(Failure); }
public virtual int _GetUniqueIdentifier() { var hashCode = 399326290; hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (TotalTime?.GetHashCode() ?? 0); return(hashCode); }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + TitleUnicode.GetHashCode(); hash = hash * 23 + TitleRoman.GetHashCode(); hash = hash * 23 + ArtistUnicode.GetHashCode(); hash = hash * 23 + ArtistRoman.GetHashCode(); hash = hash * 23 + Creator.GetHashCode(); hash = hash * 23 + DiffName.GetHashCode(); hash = hash * 23 + Mp3Name.GetHashCode(); hash = hash * 23 + Md5.GetHashCode(); hash = hash * 23 + OsuFileName.GetHashCode(); hash = hash * 23 + Tags.GetHashCode(); hash = hash * 23 + Somestuff.GetHashCode(); hash = hash * 23 + _state.GetHashCode(); hash = hash * 23 + Circles.GetHashCode(); hash = hash * 23 + Sliders.GetHashCode(); hash = hash * 23 + Spinners.GetHashCode(); hash = hash * 23 + EditDate.GetHashCode(); hash = hash * 23 + ApproachRate.GetHashCode(); hash = hash * 23 + CircleSize.GetHashCode(); hash = hash * 23 + HpDrainRate.GetHashCode(); hash = hash * 23 + OverallDifficulty.GetHashCode(); hash = hash * 23 + SliderVelocity.GetHashCode(); hash = hash * 23 + DrainingTime.GetHashCode(); hash = hash * 23 + TotalTime.GetHashCode(); hash = hash * 23 + PreviewTime.GetHashCode(); hash = hash * 23 + MapId.GetHashCode(); hash = hash * 23 + MapSetId.GetHashCode(); hash = hash * 23 + ThreadId.GetHashCode(); hash = hash * 23 + OsuGrade.GetHashCode(); hash = hash * 23 + TaikoGrade.GetHashCode(); hash = hash * 23 + CatchGrade.GetHashCode(); hash = hash * 23 + ManiaGrade.GetHashCode(); hash = hash * 23 + Offset.GetHashCode(); hash = hash * 23 + StackLeniency.GetHashCode(); hash = hash * 23 + PlayMode.GetHashCode(); hash = hash * 23 + Source.GetHashCode(); hash = hash * 23 + AudioOffset.GetHashCode(); hash = hash * 23 + LetterBox.GetHashCode(); hash = hash * 23 + Played.GetHashCode(); hash = hash * 23 + LastPlayed.GetHashCode(); hash = hash * 23 + IsOsz2.GetHashCode(); hash = hash * 23 + Dir.GetHashCode(); //hash = hash * 23 + LastSync.GetHashCode(); //This value is updated by osu even if no changes were made to the actual data hash = hash * 23 + DisableHitsounds.GetHashCode(); hash = hash * 23 + DisableSkin.GetHashCode(); hash = hash * 23 + DisableSb.GetHashCode(); hash = hash * 23 + BgDim.GetHashCode(); hash = hash * 23 + ModPpStars.GetHashCode(); hash = hash * 23 + MaxBpm.GetHashCode(); hash = hash * 23 + MinBpm.GetHashCode(); hash = hash * 23 + MainBpm.GetHashCode(); return(hash); } }
public override int GetHashCode() { int hash = 1; if (TotalPathLength != 0D) { hash ^= TotalPathLength.GetHashCode(); } if (TotalTime != 0D) { hash ^= TotalTime.GetHashCode(); } if (PreferredAccel != 0D) { hash ^= PreferredAccel.GetHashCode(); } if (PreferredDecel != 0D) { hash ^= PreferredDecel.GetHashCode(); } if (MaxAccel != 0D) { hash ^= MaxAccel.GetHashCode(); } if (MinDecel != 0D) { hash ^= MinDecel.GetHashCode(); } if (SpeedLimitBuffer != 0D) { hash ^= SpeedLimitBuffer.GetHashCode(); } if (SpeedWeight != 0D) { hash ^= SpeedWeight.GetHashCode(); } if (JerkWeight != 0D) { hash ^= JerkWeight.GetHashCode(); } if (ObstacleWeight != 0D) { hash ^= ObstacleWeight.GetHashCode(); } if (UnblockingObstacleCost != 0D) { hash ^= UnblockingObstacleCost.GetHashCode(); } if (stBoundaryConfig_ != null) { hash ^= StBoundaryConfig.GetHashCode(); } return(hash); }
protected override void BeginProcessing() { TotalTime.Start(); //total files: CObject.Files.Length CObject = new ConverterOptions { Files = Directory.GetFiles(Input, "*.CR2"), OutputDirectory = Output }; base.BeginProcessing(); }
private void PlayAudio(string audioFile) { if (GlobalUser.WavePlayer?.PlaybackState == PlaybackState.Playing) { CleanUp(); PlayIconKind.Kind = PackIconKind.Play; PlayTime = 0; return; } try { GlobalUser.WavePlayer = CreateWavePlayer(); if (!audioFile.Contains("http://")) { audioFile = $"http://{audioFile}"; } try { var reader = new MediaFoundationReader($"{audioFile}.mp3"); SliderTimer.Maximum = TotalTime = Convert.ToInt32(reader.TotalTime.TotalSeconds); TxtPlayTime.Text = TotalTime.ToString(); GlobalUser.WavePlayer.Init(reader); } catch (Exception) { var oggReader = new VorbisWaveReader($"{audioFile}.ogg"); SliderTimer.Maximum = TotalTime = Convert.ToInt32(oggReader.TotalTime.TotalSeconds); TxtPlayTime.Text = TotalTime.ToString(); GlobalUser.WavePlayer.Init(oggReader); } GlobalUser.WavePlayer.PlaybackStopped += OnPlaybackStopped; SliderTimer.Value = PlayTime = 0; _dTimer.Start(); PlayIconKind.Kind = PackIconKind.Stop; GlobalUser.WavePlayer.Play(); } catch (Exception e) { Log4NetHelper.Error(String.Format("Play Error {0}", e.Message)); } }
public override int GetHashCode() { unchecked { int hashCode = Vehicles; hashCode = (hashCode * 397) ^ SmallestRoundCategory; hashCode = (hashCode * 397) ^ LargestRoundCategory; hashCode = (hashCode * 397) ^ TotalTime.GetHashCode(); hashCode = (hashCode * 397) ^ MinimumTime.GetHashCode(); hashCode = (hashCode * 397) ^ MaximumTime.GetHashCode(); hashCode = (hashCode * 397) ^ (LargestRoundCategories != null ? LargestRoundCategories.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SmallestRoundCategories != null ? SmallestRoundCategories.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Feasable.GetHashCode(); return(hashCode); } }
public T Leave <T>( Exception?exception, TimeSpan elapsed, Func <TimeSpan, ActionStats, T> map) { lock (this) { if (exception != null) { TotalFailed++; } TotalCalls++; TotalTime = TotalTime.Add(elapsed); var result = map(elapsed, this); ConcurrentCalls--; return(result); } }
public void Print() { var consoleTable = new ConsoleTable(200); consoleTable.PrintLine(); consoleTable.PrintRow("Nome", "Tamanho", "Path", "Iterações", "Tempo Total", "Tempo Médio"); consoleTable.PrintLine(); consoleTable.PrintRow( FileName, FileSize.ToString(), Path, Iterations.ToString(), TotalTime.ToString(), AverageTime.ToString()); consoleTable.PrintLine(); Console.ReadLine(); }
private void Timer_Tick(object sender, EventArgs e) { if (exercisePosition == Exercises.list.Length - 1) { timer.Stop(); return; } if (Counter == 30) { Counter = 0; exercisePosition++; Exercise = Exercises.list[exercisePosition]; NextExercise = exercisePosition == Exercises.list.Length - 1 ? "Конец" : Exercises.list[exercisePosition + 1]; } TotalTime = TotalTime.Add(TimeSpan.FromSeconds(1)); Counter++; }
/// <summary> /// 刷新资源检测 /// </summary> public void EndMessage() { var a = DateTime.Now - startTime; var d = AppDomain.CurrentDomain.MonitoringTotalAllocatedMemorySize; var f = AppDomain.CurrentDomain.MonitoringSurvivedMemorySize; message = string.Format("|完成| {0:HH:mm:ss} |{1}/{10}|{2}|{3}|{4}|{5}|{6}|"//{7}|{8}|{9}| , DateTime.Now, TotalTime.ToFixLenString(7, 1) , TotalProcessorTime.ToFixLenString(10, 2) , (TotalAllocatedMemorySize / 1024F).ToFixLenString(10, 3) , (d / 1048576F).ToFixLenString(10, 3) , (TotalSurvivedMemorySize / 1024F).ToFixLenString(10, 3) , (f / 1048576F).ToFixLenString(10, 3) , NumberA.ToFixLenString(10) , NumberB.ToFixLenString(10) , NumberC.ToFixLenString(10) , a.TotalMilliseconds.ToFixLenString(7, 1)); }
public void AccumulateTime() { TimeFromLaunched = TimeFromLaunched.Add(TimeSpan.FromSeconds(Settings.CountingSecondsInterval)); //指定した時間が経過していたら、データの記録を開始 if (TimeFromLaunched.TotalSeconds >= Settings.MinCountStartTime) { if (!IsCountStarted) { TotalTime = TotalTime.Add(TimeSpan.FromSeconds(Settings.MinCountStartTime)); IsCountStarted = true; } else { TotalTime = TotalTime.Add(TimeSpan.FromSeconds(Settings.CountingSecondsInterval)); } } }
public ITotalTime Create( decimal value) { ITotalTime result = null; try { result = new TotalTime( value); } catch (Exception exception) { this.Log.Error( exception.Message, exception); } return(result); }
public string RandomStat() { switch (r.Next(1, 6)) { case 1: return($"There have been {TotalRunsCount} runs submitted to SRC."); case 2: return($"There have been {FullRunsCount} full-game runs submitted to SRC."); case 3: return($"There have been {LevelRunsCount} individual-level runs submitted to SRC."); case 4: return($"{(int)TotalTime.TotalHours}:{TotalTime.ToString(Program.timeFormatWithMinutes)} is the combined time of all records for SRB2."); case 5: return($"{LatestRun}"); } return(""); }
private async void Tick() { UpdateShuttle(); _logger.LogDebug($"Total Time: {TotalTime}"); _logger.LogDebug($"Time Left: {CurrentShuttleTimeLeft}"); PercentageRemaingInCurrentLevel = (CurrentShuttleTimeLeft.TotalSeconds / (CurrentShuttle.CommulativeTime - CurrentShuttle.StartTime) .TotalSeconds) * 100; TotalTime = TotalTime.Add(new TimeSpan(0, 0, 1)); CurrentShuttleTimeLeft = CurrentShuttleTimeLeft.Add(new TimeSpan(0, 0, -1)); if (CurrentShuttleTimeLeft < new TimeSpan(0, 0, -1)) { EndTest(); } await InvokeAsync(StateHasChanged); }
private void MonoCefBrowser_Paint(object sender, OnPaintEventArgs e) { if (e.DirtyRect.Width == 0 || e.DirtyRect.Height == 0) { return; } TotalTime.Start(); var bmp = this.ScreenshotOrNull(PopupBlending.Main); Texture2D texture = null; if (bmp != null) { texture = GetTexture(bmp, e.DirtyRect); RenderCount++; //Console.WriteLine($"{TotalTime.ElapsedMilliseconds / (double)RenderCount}"); } TotalTime.Stop(); if (texture != null) { this.NewFrame?.Invoke(this, new NewFrameEventArgs(texture)); } }
public void AddTime(string time) { int hours = 0, minutes = 0, seconds = 0; TimeSpan addedTime, totTime; var words = time.Split(':'); hours = Convert.ToInt32(words[0]); minutes = Convert.ToInt32(words[1]); seconds = Convert.ToInt32(words[2]); addedTime = new TimeSpan(hours, minutes, seconds); words = TotalTime.Split(':'); hours = Convert.ToInt32(words[0]); minutes = Convert.ToInt32(words[1]); seconds = Convert.ToInt32(words[2]); totTime = new TimeSpan(hours, minutes, seconds); totalTime = (totTime + addedTime).ToString(); }
public void Simulate() { TotalTime.Reset(); TotalTime.Start(); }
protected bool Equals(Fitness other) { return(Vehicles == other.Vehicles && SmallestRoundCategory == other.SmallestRoundCategory && LargestRoundCategory == other.LargestRoundCategory && TotalTime.Equals(other.TotalTime) && MinimumTime.Equals(other.MinimumTime) && MaximumTime.Equals(other.MaximumTime) && Equals(LargestRoundCategories, other.LargestRoundCategories) && Equals(SmallestRoundCategories, other.SmallestRoundCategories) && Feasable.Equals(other.Feasable)); }
private async void ResultForm_Load(object sender, EventArgs e) { pictureBox2.Visible = false; label1.MaximumSize = new Size(this.Width - leftIndent, this.Height); label2.MaximumSize = new Size(this.Width - leftIndent, this.Height); label3.MaximumSize = new Size(this.Width - leftIndent, this.Height); var result = String.Empty; if (Surrender.HasValue && Surrender.Value) { label3.Text = string.Format(WinMessage, UserProfile.RivalName); label1.Visible = false; label2.Text = SurrenderMassage; result = "Won"; } else if (RivalExited.HasValue && RivalExited.Value) { label3.Text = string.Format(WinMessage, UserProfile.RivalName); label1.Visible = false; label2.Text = RivalExitedMessage; result = "Won"; } else if (TimeOver.HasValue && TimeOver.Value == true) { label3.Text = TimeOverMessage; label2.Visible = false; label1.Visible = false; } else { var userTime = TotalTime.Split(':'); var userMinutes = Convert.ToInt32(userTime[0]); var userSeconds = Convert.ToInt32(userTime[1]); var userTotalSeconds = userMinutes * 60 + userSeconds; var rivalTime = RivalTotalTime.Split(':'); var rivalMinutes = Convert.ToInt32(rivalTime[0]); var rivalSeconds = Convert.ToInt32(rivalTime[1]); var rivalTotalSeconds = rivalMinutes * 60 + rivalSeconds; label1.Text = string.Format(UserTemplateMessage, TotalTime, TotalPoints); label2.Text = string.Format(RivalTemplateMessage, RivalTotalTime, RivalTotalPoints); if (TotalPoints > RivalTotalPoints || (TotalPoints == RivalTotalPoints && userTotalSeconds < rivalTotalSeconds)) { label3.Text = string.Format(WinMessage, UserProfile.RivalName); result = "Won"; } else if (TotalPoints == RivalTotalPoints && userTotalSeconds == rivalTotalSeconds) { label3.Text = string.Format(DrawMessage, UserProfile.RivalName); result = "Draw"; } else { label3.Text = string.Format(LoseMessage, UserProfile.RivalName); result = "Lost"; } } await gameSessionService.AddResultToGameSessionUser(UserProfile.GamaSessionId, UserProfile.Id, result); }
/// <summary> /// Adds the time to the total time spent on activities. /// </summary> /// <param name="time">The time to add.</param> public void AddTime(TimeSpan time) { TotalTime = TotalTime.Add(time); }
private void UpdatePlayingSongDisplayText(object sender, EventArgs e) { DisplayText = CurrentTime.ToString("mm\\:ss") + " / " + TotalTime.ToString("mm\\:ss"); }
public string ExportToXML() { XmlDocument timingData = new XmlDocument(); XmlNode surveyNode = timingData.CreateElement("SurveyTiming"); timingData.AppendChild(surveyNode); XmlAttribute surveyCode = timingData.CreateAttribute("Survey"); surveyCode.Value = SurveyCode; surveyNode.Attributes.Append(surveyCode); XmlAttribute runTitle = timingData.CreateAttribute("RunTitle"); runTitle.Value = Title; surveyNode.Attributes.Append(runTitle); XmlAttribute scheme = timingData.CreateAttribute("TimingScheme"); scheme.Value = "WholeSurvey"; surveyNode.Attributes.Append(scheme); XmlAttribute notes = timingData.CreateAttribute("Notes"); notes.Value = Notes; surveyNode.Attributes.Append(notes); XmlNode timing = timingData.CreateElement("Time"); XmlAttribute time = timingData.CreateAttribute("Mins"); time.Value = TotalTime.ToString(); timing.Attributes.Append(time); XmlAttribute wpm = timingData.CreateAttribute("WPM"); wpm.Value = WPM.ToString(); timing.Attributes.Append(wpm); XmlAttribute startQ = timingData.CreateAttribute("StartQ"); startQ.Value = StartQ.ToString(); timing.Attributes.Append(startQ); surveyNode.AppendChild(timing); XmlNode questions = timingData.CreateElement("Questions"); surveyNode.AppendChild(questions); // add all varnames and their filter vars foreach (LinkedQuestion q in Questions) { XmlNode varname = timingData.CreateElement("Question"); XmlAttribute name = timingData.CreateAttribute("VarName"); name.Value = q.VarName.FullVarName; varname.Attributes.Append(name); XmlAttribute refname = timingData.CreateAttribute("refVarName"); refname.Value = q.VarName.RefVarName; varname.Attributes.Append(refname); XmlAttribute varlabel = timingData.CreateAttribute("VarLabel"); varlabel.Value = q.VarName.VarLabel; varname.Attributes.Append(varlabel); XmlAttribute qnum = timingData.CreateAttribute("Qnum"); qnum.Value = q.Qnum; varname.Attributes.Append(qnum); // wordings XmlAttribute prep = timingData.CreateAttribute("PreP"); prep.Value = q.PreP; varname.Attributes.Append(prep); XmlAttribute prei = timingData.CreateAttribute("PreI"); prei.Value = q.PreI; varname.Attributes.Append(prei); XmlAttribute prea = timingData.CreateAttribute("PreA"); prea.Value = q.PreA; varname.Attributes.Append(prea); XmlAttribute litq = timingData.CreateAttribute("LitQ"); litq.Value = q.LitQ; varname.Attributes.Append(litq); XmlAttribute psti = timingData.CreateAttribute("PstI"); psti.Value = q.PstI; varname.Attributes.Append(psti); XmlAttribute pstp = timingData.CreateAttribute("PstP"); pstp.Value = q.PstP; varname.Attributes.Append(pstp); XmlAttribute respoptions = timingData.CreateAttribute("RespOptions"); respoptions.Value = q.RespOptions; varname.Attributes.Append(respoptions); XmlAttribute respname = timingData.CreateAttribute("RespName"); respname.Value = q.RespName; varname.Attributes.Append(respname); XmlAttribute nrcodes = timingData.CreateAttribute("NRCodes"); nrcodes.Value = q.NRCodes; varname.Attributes.Append(nrcodes); XmlNode scenarios = timingData.CreateElement("Scenarios"); varname.AppendChild(scenarios); // filters foreach (List <FilterInstruction> filterList in q.FilterList) { XmlNode scenario = timingData.CreateElement("Scenario"); foreach (FilterInstruction fi in filterList) { XmlNode filter = timingData.CreateElement("FilterInstruction"); XmlAttribute var = timingData.CreateAttribute("VarName"); var.Value = fi.VarName; filter.Attributes.Append(var); XmlAttribute oper = timingData.CreateAttribute("Operation"); oper.Value = fi.Oper.ToString(); filter.Attributes.Append(oper); XmlNode responses = timingData.CreateElement("Responses"); filter.AppendChild(responses); foreach (string responseValue in fi.ValuesStr) { XmlNode response = timingData.CreateElement("Response"); XmlAttribute resp = timingData.CreateAttribute("ResponseValue"); resp.Value = responseValue; response.Attributes.Append(resp); responses.AppendChild(response); } scenario.AppendChild(filter); } scenarios.AppendChild(scenario); } // weight info XmlAttribute weight = timingData.CreateAttribute("Weight"); weight.Value = q.Weight.Value.ToString(); varname.Attributes.Append(weight); XmlAttribute weightSource = timingData.CreateAttribute("WeightSource"); weightSource.Value = q.Weight.Source; varname.Attributes.Append(weightSource); questions.AppendChild(varname); } return(timingData.InnerXml); }