Added build time calculation

This commit is contained in:
Scalpel_cp 2008-07-18 20:29:32 +00:00
parent 1dbf890b13
commit b6d643ff82
2 changed files with 22 additions and 17 deletions

View file

@ -94,8 +94,8 @@ namespace Cosmos.Build.Windows {
long remaining = ((xBuildTimer.ElapsedMilliseconds) / percentComplete) * (100 - percentComplete);
if (completedCount == 10 || completedCount == 780)
MessageBox.Show("One percent takes " + xBuildTimer.ElapsedMilliseconds / percentComplete);
//if (completedCount == 10 || completedCount == 780)
// MessageBox.Show("One percent takes " + xBuildTimer.ElapsedMilliseconds / percentComplete);
return new TimeSpan(remaining * 1000 * 10);
}

View file

@ -196,21 +196,26 @@ namespace Cosmos.Build.Windows {
mBuilder.DebugLog += xBuildWindow.DoDebugMessage;
mBuilder.ProgressChanged += delegate(int aMax,
int aCurrent) {
xBuildWindow.progressText.Content = String.Format("Processing method {0:d} of {1:d}",
aCurrent,
aMax);
xBuildWindow.ProgressMax = aMax;
xBuildWindow.ProgressCurrent = aCurrent;
var xFrame = new DispatcherFrame();
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input,
new DispatcherOperationCallback(delegate(object aParam) {
xFrame.Continue = false;
return null;
}),
null);
Dispatcher.PushFrame(xFrame);
};
int aCurrent)
{
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,
aMax, Environment.NewLine, xRemainingTime);
xBuildWindow.ProgressMax = aMax;
xBuildWindow.ProgressCurrent = aCurrent;
var xFrame = new DispatcherFrame();
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Input,
new DispatcherOperationCallback(delegate(object aParam)
{
xFrame.Continue = false;
return null;
}),
null);
Dispatcher.PushFrame(xFrame);
};
xBuildWindow.Show();
try {
mBuilder.Compile(mDebugMode,