/// <summary> /// 刷新资源检测 /// </summary> public void EndMessage() { var a = DateTime.Now - startTime; #if !NETSTANDARD2_0 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)); #else message = string.Format("|完成| {0:HH:mm:ss} |{1}/{2}|" , DateTime.Now , TotalTime.ToFixLenString(7, 1) , a.TotalMilliseconds.ToFixLenString(7, 1)); #endif }
/// <summary> /// 刷新消息 /// </summary> /// <returns></returns> public void FlushMessage() { var a = DateTime.Now - preTime; var b = AppDomain.CurrentDomain.MonitoringTotalProcessorTime - MonitoringTotalProcessorTime; var c = AppDomain.CurrentDomain.MonitoringTotalAllocatedMemorySize - MonitoringTotalAllocatedMemorySize; var d = AppDomain.CurrentDomain.MonitoringTotalAllocatedMemorySize; var e = AppDomain.CurrentDomain.MonitoringSurvivedMemorySize - MonitoringSurvivedMemorySize; var f = AppDomain.CurrentDomain.MonitoringSurvivedMemorySize; message = string.Format("| ☆ | - |{0}|{1}|{2}|{3}|{4}|{5}|"//{6}|{7}|{8}| , a.TotalMilliseconds.ToFixLenString(15, 2) , b.TotalMilliseconds.ToFixLenString(10, 2) , (c / 1024F).ToFixLenString(10, 3) , (d / 1048576F).ToFixLenString(10, 3) , (e / 1024F).ToFixLenString(10, 3) , (f / 1048576F).ToFixLenString(10, 3) , NumberA.ToFixLenString(10) , NumberB.ToFixLenString(10) , NumberC.ToFixLenString(10)); }