Exemplo n.º 1
0
        /// <summary>
        /// Calculates GCD of two numbers.
        /// </summary>
        /// <param name="first">The first number.</param>
        /// <param name="second">The second number.</param>
        /// <returns>
        /// The GCD of two numbers.
        /// </returns>
        public override int Calculate(int first, int second)
        {
            _stopWatcher.Start();
            int result = Algorithm.Calculate(first, second);

            _stopWatcher.Stop();

            Milliseconds = _stopWatcher.TimeInMilliseconds;

            _logger.Info($"Runtime of a method with two variables: {Milliseconds}");
            _logger.Info($"Result solution: {result.ToString()}");

            return(result);
        }
        public int Calculate(int first, int second)
        {
            stopWatch.Start();

            int gcd = algorithm.Calculate(first, second);

            stopWatch.Stop();
            TimeInMilliseconds = stopWatch.TimeInMilliseconds;

            return(gcd);
        }