public int[] GenerateDistinctYears(int[] years, int repetition, out long executionTime) { Stopwatch watch = new Stopwatch(); DistinctYear distinctYear = new DistinctYear(); int numberOfYears = years.Length; int[] returnedYears = new int[numberOfYears]; //Find the next year and asign the result in the outputArray watch.Start(); for (int j = 0; j < repetition; j++) { if (j != 0) { for (int i = 0; i < numberOfYears; i++) { distinctYear.FindNext(years[i]); } } else { for (int i = 0; i < numberOfYears; i++) { returnedYears[i] = distinctYear.FindNext(years[i]); } } } watch.Stop(); executionTime = watch.ElapsedMilliseconds; return(returnedYears); }
//============================================ Constructor ========================================================= public MainMenu() { check = new Check(); distinctYear = new DistinctYear(); watch = new Stopwatch(); random = new Random(); generate = new Generate(); }