/// <summary> /// 依據執行時間是否超過容忍上限記錄log /// </summary> /// <param name="timeCost">執行時間</param> /// <param name="logInfo">log訊息</param> private static void LogPerformance(TimeSpan timeCost, string logInfo) { if (timeCost < bound) { PerformanceLogger.Info(string.Format("{0} [{1} ms]", logInfo, timeCost.TotalMilliseconds)); } else { PerformanceLogger.Warn(string.Format("{0} [{1} ms]", logInfo, timeCost.TotalMilliseconds)); } }