Example #1
0
        /// <summary>
        /// Run a simple benchmark with the supplied action and call the logger action supplied.
        /// </summary>
        /// <param name="name">The name of the action to benchmark</param>
        /// <param name="message">A message associated w/ the action to benchmark</param>
        /// <param name="logger">The callback method for logging purposes.</param>
        /// <param name="action">The action to benchmark.</param>
        public static void Get(string name, string message, Action <BenchmarkResult> logger, Action <BenchmarkService> action)
        {
            BenchmarkService service = new BenchmarkService(name, message, logger);

            action(service);
        }
Example #2
0
        /// <summary>
        /// Run a simple benchmark with the supplied action and call the logger action supplied.
        /// </summary>
        /// <param name="name">The name of the action to benchmark</param>
        /// <param name="message">A message associated w/ the action to benchmark</param>
        /// <param name="logger">The callback method for logging purposes.</param>
        /// <param name="action">The action to benchmark.</param>
        public static BenchmarkResult Report(string name, string message, Action <BenchmarkResult> logger, Action action)
        {
            BenchmarkService service = _service == null ? new BenchmarkService() : _service;

            return(service.Report(name, message, logger, action));
        }