mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-21 13:28:41 +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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue