mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 13:51:53 +08:00
enhance: more readable command log duration (#1570)
This commit is contained in:
@@ -68,11 +68,14 @@ namespace SourceGit.Views
|
||||
}
|
||||
}
|
||||
|
||||
private string GetDisplayText(ViewModels.CommandLog log)
|
||||
private static string GetDisplayText(ViewModels.CommandLog log)
|
||||
{
|
||||
var endTime = log.IsComplete ? log.EndTime : DateTime.Now;
|
||||
var duration = (endTime - log.StartTime).ToString(@"hh\:mm\:ss\.fff");
|
||||
return $"{log.StartTime:T} ({duration})";
|
||||
var duration = endTime - log.StartTime;
|
||||
var durationStr = duration.TotalSeconds >= 1
|
||||
? $"{duration.TotalSeconds:G3} s"
|
||||
: $"{duration.TotalMilliseconds:G3} ms";
|
||||
return $"{log.StartTime:T} ({durationStr})";
|
||||
}
|
||||
|
||||
private Timer _refreshTimer = null;
|
||||
|
||||
Reference in New Issue
Block a user