Elapsed time to load a project was 6.77 secs
Elapsed time to set duration of a task was 6.34 secs
Elapsed time to recalculate all project was 30.00 secs
[TestMethod]
public void Slowly_Calculation()
{
/*
* Aguardando feedback do Aspose
*
*/
using (var stream = LoadFromAssembly(“CronogramaCom1000Tarefas.mpp”))
{
TimeSpan timeToLoad, timeToCalculateTask, timeToRecalculateTask;
var timer = new Stopwatch();
timer.Start();
var project = new Project(stream);
timer.Stop();
timeToLoad = timer.Elapsed;
timer.Reset();
timer.Start();
var task = project.RootTask.Children.GetById(31);
task.Set(Tsk.Duration, project.GetDuration(9, TimeUnitType.Day));
timer.Stop();
timeToCalculateTask = timer.Elapsed;
timer.Reset();
timer.Start();
project.Recalculate();
timer.Stop();
timeToRecalculateTask = timer.Elapsed;
Assert.IsTrue(timeToLoad < TimeSpan.FromSeconds(3), $@"A abertura demorou {timer.Elapsed.TotalSeconds} segundos");
Assert.IsTrue(timeToCalculateTask < TimeSpan.FromSeconds(3), $@"O cálculo demorou {timer.Elapsed.TotalSeconds} segundos");
Assert.IsTrue(timeToRecalculateTask < TimeSpan.FromSeconds(3), $@"O recálculo demorou {timer.Elapsed.TotalSeconds} segundos");
}
}CronogramaCom1000Tarefas.zip (644.0 KB)