监控时间
This commit is contained in:
@@ -56,6 +56,33 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public string UploadStartTimeStr => UploadStartTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
public string UploadFinishedTimeStr => UploadFinishedTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
|
||||
|
||||
public string TimeInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
var tSpan = UploadFinishedTime - UploadStartTime;
|
||||
|
||||
if (tSpan.Seconds == 0 && tSpan.Minutes==0 && tSpan.Hours == 0)
|
||||
{
|
||||
return $"{tSpan.Milliseconds}毫秒";
|
||||
}
|
||||
else if ( tSpan.Minutes == 0 && tSpan.Hours == 0)
|
||||
{
|
||||
return $"{tSpan.Seconds}秒";
|
||||
}
|
||||
else if ( tSpan.Hours == 0)
|
||||
{
|
||||
return $"{tSpan.Minutes} 分钟 {tSpan.Seconds} 秒";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $" {tSpan.Hours} 小时 {tSpan.Minutes} 分钟 {tSpan.Seconds} 秒";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime UploadStartTime { get; set; }
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user