Beispiel #1
0
        public static void ExecutionTime(
        Action codeToExecute,
        Action<StopWatchEx> processResult)
        {
            if (codeToExecute == null)
                throw new ArgumentNullException("codeToExecute");

            var sw = new StopWatchEx();
            sw.Start();
            codeToExecute();
            sw.Stop();
            if (processResult != null)
                processResult(sw);

        }
Beispiel #2
0
 public void Start()
 {
     this.Started = DateTime.Now;
     sw.Start();
 }