CSharp examples for System:Action
Time an Action
using System.Text; using System.Linq; using System.Diagnostics; using System.Collections.Generic; using System;/* www . j a v a2 s. co m*/ public class Main{ public static double Action(Action ac) { Stopwatch sw = new Stopwatch(); sw.Start(); ac?.Invoke(); sw.Stop(); return sw.Elapsed.TotalMilliseconds; } }