public RouteValueDictionary GetRouteValues(string memberName) { var prefix = String.IsNullOrWhiteSpace(memberName) ? null : memberName + '.'; var result = new RouteValueDictionary(); if (Source != null) { foreach (var item in Source.GetRouteValues(nameof(Source))) { result.Add(prefix + item.Key, item.Value); } } if (MinLevel != null && MinLevel.Value != DefaultMinLevel) { foreach (var item in MinLevel.GetRouteValues(nameof(MinLevel))) { result.Add(prefix + item.Key, item.Value); } } if (!String.IsNullOrWhiteSpace(Logger)) { result.Add(prefix + nameof(Logger), Logger); } if (!String.IsNullOrWhiteSpace(Thread)) { result.Add(prefix + nameof(Thread), Thread); } if (MinTime > DefaultMinTime) { result.Add(prefix + nameof(MinTime), MinTime.ToString(DateFormat)); } if (MaxTime < DefaultMaxTime) { result.Add(prefix + nameof(MaxTime), MaxTime.ToString(DateFormat)); } if (!String.IsNullOrWhiteSpace(Message)) { result.Add(prefix + nameof(Message), Message); } if (!String.IsNullOrWhiteSpace(Throwable)) { result.Add(prefix + nameof(Throwable), Throwable); } if (Quantity != null && Quantity.Value != DefaultQuantity) { foreach (var item in Quantity.GetRouteValues(nameof(Quantity))) { result.Add(prefix + item.Key, item.Value); } } if (Offset > DefaultOffset) { result.Add(prefix + nameof(Offset), Offset); } return(result); }
public void PrintStatistic() { Console.WriteLine("Benchmark name: " + Name); Console.WriteLine("Iterations: " + Iterations); Console.WriteLine("Avg time per iteration: " + AvgTime.ToString("0.000") + " ms"); Console.WriteLine("Min time per iteration: " + MinTime.ToString("0.000") + " ms"); Console.WriteLine("Max time per iteration: " + MaxTime.ToString("0.000") + " ms"); }
public int CompareTo(Block other) { if (Sid == other.Sid) { return(MinTime.CompareTo(other.MinTime)); } return(Sid.CompareTo(other.Sid)); }
private void SetDefaults() { MinorGrid.Enabled = false; Minimum = MinTime.ToOADate(); Maximum = MaxTime.ToOADate(); SetupIntervalAndLabeling(); }
/// <inheritdoc /> public override int GetHashCode() { unchecked { int hashCode = ChatId != null?ChatId.GetHashCode() : 0; hashCode = (hashCode * 397) ^ LastMessageNumber.GetHashCode(); hashCode = (hashCode * 397) ^ Last.GetHashCode(); hashCode = (hashCode * 397) ^ Limit.GetHashCode(); hashCode = (hashCode * 397) ^ MinTime.GetHashCode(); hashCode = (hashCode * 397) ^ MaxTime.GetHashCode(); return(hashCode); } }
private static void DoTest(StreamReader sr) { string[] nGoal = sr.ReadLine().Split(' '); int n = Convert.ToInt32(nGoal[0]); long goal = Convert.ToInt64(nGoal[1]); long[] machines = Array.ConvertAll(sr.ReadLine().Split(' '), machinesTemp => Convert.ToInt64(machinesTemp)) ; long ans = MinTime.minTime(machines, goal); Console.WriteLine(ans); }
public Dictionary <string, object> ToDictionary() { return(_lock.Read(() => { return new Dictionary <string, object> { { "hits", HitCount }, { "total", TotalExecutionTime.ToString("N") }, { "average", Average.ToString("N") }, { "exceptions", ExceptionPercentage.ToString("N") }, { "min", MinTime.ToString("N") }, { "max", MaxTime.ToString("N") } }; })); }
public string[] ToStringArray(int digits) { return(new[] { AssemblyName, MethodName, AvgTime.ToString($"F{digits}", CultureInfo.InvariantCulture) /*.Replace(".", ",")*/, //slk . ; in csv , ! TicksNum.ToString(), MinTime.ToString($"F{digits}", CultureInfo.InvariantCulture) /*.Replace(".", ",")*/, //slk . ; in csv , ! MaxTime.ToString($"F{digits}", CultureInfo.InvariantCulture) /*.Replace(".", ",")*/, //slk . ; in csv , ! TimeSpent.ToString(), AvgKB.ToString(), AllocKB.ToString(), PatchOwners }); }
/// <summary> /// 对象转换为DateTime /// </summary> /// <param name="val">对象</param> /// <param name="format">DateTime格式</param> /// <returns>string</returns> public static string ObjectToDateTime(this object val, string format) { if (val == null) { return(MinTime.ToString(format)); } try { return(Convert.ToDateTime(val).ToString(format)); } catch { return(MinTime.ToString(format)); } }
public static void Write(TextWriter writer) { TotalTime = TotalTimes.Sum(); var elapsed = DateTime.UtcNow - Start; var avg = TotalTime / TotalCount; Array.Sort(QuantileSample); writer.WriteLine("Requests/sec: {0}", (TotalCount / (elapsed.TotalSeconds + 0.000001)).ToStdString()); writer.WriteLine("Min time: {0} ms", MinTime.TicksToMs()); writer.WriteLine("Max time: {0} ms", MaxTime.TicksToMs()); writer.WriteLine("Avg time: {0} ms", avg.TicksToMs()); writer.WriteLine("Median time: {0} ms", QuantileSample[QuantileSample.Length >> 1].TicksToMs()); writer.WriteLine("Std deviation: {0}", Math.Sqrt((double)QuantileSample.Sum(time => (time - avg) * (time - avg)) / (QuantileSample.Length - 1)).TicksToMs().ToStdString(suffix: "ms")); writer.WriteLine(); writer.WriteLine("Time taken: {0}", elapsed.TotalSeconds.ToStdString(suffix: "sec")); writer.WriteLine("Data received: {0}", TotalBytes.ToSmartString(suffix: "B")); writer.WriteLine("Transfer rate: {0}", (TotalBytes / (elapsed.TotalSeconds + 0.000001)).ToSmartString(suffix: "B/sec")); writer.WriteLine(); writer.WriteLine("=== http status codes ==="); HttpCodes.OrderBy(pair => pair.Key).ForEach(pair => writer.WriteLine("{0,10}\t{1,-10}\t{2}", pair.Value, pair.Key == 0 ? "Unknown error" : ((int)pair.Key).ToString(), ((double)pair.Value / TotalCount).ToPercentString())); writer.WriteLine(); writer.WriteLine("=== quantiles ==="); for (int i = 0; i < Quantiles.Length; i++) { var quantile = Quantiles[i]; writer.WriteLine("{0,10}\t{1} ms", quantile.ToPercentString(), QuantileSample[Math.Max(1, quantile * QuantileSample.Length / 100) - 1].TicksToMs()); } writer.WriteLine(); long sum = 0; writer.WriteLine("=== times ==="); for (int i = 0; i < Marks.Length; i++) { sum += TotalCounts[i]; writer.WriteLine("{0,10}\t{1,-10}\t{2}", TotalCounts[i], $"<{(Marks[i] == long.MaxValue ? "inf" : Marks[i].TicksToMs().ToString())} ms", ((double)sum / TotalCount).ToPercentString()); } writer.WriteLine("----------"); writer.WriteLine("{0,10}\t{1,-10}\t{2}", TotalCount, $"<{MaxTime.TicksToMs()} ms", 1.0.ToPercentString()); }
//查询出库表 public static PageList DeliveryAll(int PageIndex, int PageSize, int Day) { DateTime MaxTime; DateTime MinTime; if (Day != 0) { MaxTime = DateTime.Now; MinTime = DateTime.Now; MinTime.AddDays(-Day); } else { MaxTime = DateTime.MaxValue; MinTime = DateTime.MinValue; } return(DeliveryService.DeliveryAll(PageIndex, PageSize, MaxTime, MinTime)); }
private void GetRangeBtn_Click(object sender, EventArgs e) { unsafe { UInt16 LastErrCode; UInt32 MaxTime; UInt32 *pMaxTime = &MaxTime; UInt32 MinTime; UInt32 *pMinTime = &MinTime; LastErrCode = Watch_Dog_API.WD_GetRange(pMinTime, pMaxTime); if (LastErrCode != IMC_ERR_NO_ERROR) { MessageBox.Show("Fails to get Watch Dog timer ragne"); return; } TimeMinTxt.Text = MinTime.ToString(); TimeMaxTxt.Text = MaxTime.ToString(); } }
protected override void ProcessRecord() { BaseParameters = new Dictionary <string, string> { { "BranchName", BranchName }, { "RepositoryId", RepositoryId }, { "RepositoryType", RepositoryType }, { "ResultFilter", ResultFilter }, { "MinTime", MinTime?.ToString() } }; var parameters = new ParallelRequestParams( "BranchName", BranchNames, BaseParameters ); var requestTasks = ParallelRequestAsync(VssAuthenticator.AzureDevOpsBuildsHost, "DefaultCollection/One/_apis/build/builds", parameters); WriteObject(requestTasks.Result); }
DateTime Value2Time(int value) { value -= Time2Value(MinTime); return(MinTime.AddMinutes(value)); }
public override void BrowseWaitVisible() { base.BrowseWaitVisible(); MinTime.WaitVisible(); }
public string ToCsvRow(int digits) { return($"{AssemblyName};{MethodName};{AvgTime.ToString($"F{digits}", CultureInfo.InvariantCulture).Replace(".", ",")};{TicksNum};{MinTime.ToString($"F{digits}", CultureInfo.InvariantCulture).Replace(".", ",")};{MaxTime.ToString($"F{digits}", CultureInfo.InvariantCulture).Replace(".", ",")};{TimeSpent};{AvgKB};{AllocKB};{PatchOwners}"); }
public int CompareTo(IndexEntry other) { return(MinTime.CompareTo(other.MinTime)); }