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); }