@@ -1645,6 +1645,7 @@ private async Task StartMergeAsync()
16451645
16461646 try
16471647 {
1648+ var startTime = DateTime . Now ;
16481649 IsBusy = true ;
16491650 StatusMessage = "准备开始合并数据..." ;
16501651 ProgressValue = 0 ;
@@ -1762,6 +1763,9 @@ private async Task StartMergeAsync()
17621763 SecondaryFilters . ToList ( ) ,
17631764 progress ) ;
17641765
1766+ var endTime = DateTime . Now ;
1767+ var duration = endTime - startTime ;
1768+
17651769 // 显示结果对话框
17661770 var successContent = new StackPanel { Margin = new Thickness ( 24 ) } ;
17671771 successContent . Children . Add ( new TextBlock
@@ -1780,12 +1784,15 @@ private async Task StartMergeAsync()
17801784 resultGrid . RowDefinitions . Add ( new RowDefinition { Height = GridLength . Auto } ) ;
17811785 resultGrid . RowDefinitions . Add ( new RowDefinition { Height = GridLength . Auto } ) ;
17821786 resultGrid . RowDefinitions . Add ( new RowDefinition { Height = GridLength . Auto } ) ;
1787+ resultGrid . RowDefinitions . Add ( new RowDefinition { Height = GridLength . Auto } ) ;
1788+
17831789
17841790 // 添加结果信息
17851791 AddResultRow ( resultGrid , 0 , "处理记录数:" , result . ProcessedRows . ToString ( ) ) ;
17861792 AddResultRow ( resultGrid , 1 , "匹配记录数:" , result . MatchedRows . ToString ( ) ) ;
17871793 AddResultRow ( resultGrid , 2 , "新增列数:" , result . NewColumnsAdded . ToString ( ) ) ;
17881794 AddResultRow ( resultGrid , 3 , "结果已保存到:" , result . OutputPath ) ;
1795+ AddResultRow ( resultGrid , 4 , "处理耗时:" , FormatDuration ( duration ) ) ;
17891796
17901797 successContent . Children . Add ( resultGrid ) ;
17911798
@@ -1938,6 +1945,22 @@ private async Task StartMergeAsync()
19381945 }
19391946 }
19401947
1948+ /// <summary>
1949+ /// 格式化时间
1950+ /// </summary>
1951+ /// <param name="duration"></param>
1952+ /// <returns></returns>
1953+ private string FormatDuration ( TimeSpan duration )
1954+ {
1955+ if ( duration . TotalHours >= 1 )
1956+ return $ "{ duration . Hours } 小时{ duration . Minutes } 分钟{ duration . Seconds } 秒";
1957+ if ( duration . TotalMinutes >= 1 )
1958+ return $ "{ duration . Minutes } 分钟{ duration . Seconds } 秒";
1959+ if ( duration . TotalSeconds >= 1 )
1960+ return $ "{ duration . Seconds } .{ duration . Milliseconds : 000} 秒";
1961+ return $ "{ duration . Milliseconds } 毫秒";
1962+ }
1963+
19411964 /// <summary>
19421965 /// 记录调试信息
19431966 /// </summary>
0 commit comments