コード例 #1
0
        /// <summary>
        /// This method is to be used as a common utility function for testing the speed of the
        /// FillDateArray method.
        /// </summary>
        public void FillDataArray_SpeedCore(int nCycles, int n, TSDateCalculator.TimeStepUnitCode unit)
        {
            var      array = new DateTime[n + 2];
            DateTime start = new DateTime(1920, 1, 1);

            for (int i = 0; i < nCycles; i++)
            {
                TSDateCalculator.FillDateArray(unit, 1, n, array, start);
            }
        }
コード例 #2
0
        /// <summary>
        /// This method is to be used as a common utility function for testing the speed of the
        /// FillDateArray method.
        /// </summary>
        public void FillDataArray_Core(TSDateCalculator.TimeStepUnitCode unit, short quantity,
                                       Func <DateTime, DateTime> func)
        {
            int      n     = 20;
            var      array = new DateTime[n + 2];
            DateTime start = new DateTime(1920, 1, 1);

            TSDateCalculator.FillDateArray(unit, quantity, n, array, start);

            for (int i = 1; i < n; i++)
            {
                Assert.AreEqual(func(array[i - 1]), array[i]);
            }
        }