mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 14:02:19 +00:00
Added build time calculation
This commit is contained in:
parent
1dbf890b13
commit
b6d643ff82
2 changed files with 22 additions and 17 deletions
|
|
@ -94,8 +94,8 @@ namespace Cosmos.Build.Windows {
|
||||||
|
|
||||||
long remaining = ((xBuildTimer.ElapsedMilliseconds) / percentComplete) * (100 - percentComplete);
|
long remaining = ((xBuildTimer.ElapsedMilliseconds) / percentComplete) * (100 - percentComplete);
|
||||||
|
|
||||||
if (completedCount == 10 || completedCount == 780)
|
//if (completedCount == 10 || completedCount == 780)
|
||||||
MessageBox.Show("One percent takes " + xBuildTimer.ElapsedMilliseconds / percentComplete);
|
// MessageBox.Show("One percent takes " + xBuildTimer.ElapsedMilliseconds / percentComplete);
|
||||||
|
|
||||||
return new TimeSpan(remaining * 1000 * 10);
|
return new TimeSpan(remaining * 1000 * 10);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -196,15 +196,20 @@ namespace Cosmos.Build.Windows {
|
||||||
|
|
||||||
mBuilder.DebugLog += xBuildWindow.DoDebugMessage;
|
mBuilder.DebugLog += xBuildWindow.DoDebugMessage;
|
||||||
mBuilder.ProgressChanged += delegate(int aMax,
|
mBuilder.ProgressChanged += delegate(int aMax,
|
||||||
int aCurrent) {
|
int aCurrent)
|
||||||
xBuildWindow.progressText.Content = String.Format("Processing method {0:d} of {1:d}",
|
{
|
||||||
|
string xRemainingTime = String.Format(System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat,
|
||||||
|
"{0:T}", new DateTime(xBuildWindow.CalculateRemainingTime(aCurrent, aMax).Ticks));
|
||||||
|
|
||||||
|
xBuildWindow.progressText.Content = String.Format("Processing method {0:d} of {1:d}{2}({3} remaining)",
|
||||||
aCurrent,
|
aCurrent,
|
||||||
aMax);
|
aMax, Environment.NewLine, xRemainingTime);
|
||||||
xBuildWindow.ProgressMax = aMax;
|
xBuildWindow.ProgressMax = aMax;
|
||||||
xBuildWindow.ProgressCurrent = aCurrent;
|
xBuildWindow.ProgressCurrent = aCurrent;
|
||||||
var xFrame = new DispatcherFrame();
|
var xFrame = new DispatcherFrame();
|
||||||
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input,
|
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input,
|
||||||
new DispatcherOperationCallback(delegate(object aParam) {
|
new DispatcherOperationCallback(delegate(object aParam)
|
||||||
|
{
|
||||||
xFrame.Continue = false;
|
xFrame.Continue = false;
|
||||||
return null;
|
return null;
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue