static void Main() { int result; long elapsed; // evaluate a bunch of code using static evaluate function. elapsed = Evaluate.Elapsed(() => { result = Multiply(1, 2); result = Multiply(2, 3); result = Multiply(3, 4); }); // evaluate with specific return value, setting elapsed by reference result = Evaluate.ElapsedWithReturn(() => Multiply(1, 2), ref elapsed); // evaluate with specific return value, getting elapsed over time from class Evaluate evaluate = new Evaluate(); result = evaluate.IncrementTimer(() => Multiply(1, 2)); result = evaluate.IncrementTimer(() => Multiply(2, 3)); elapsed = evaluate.Timer.ElapsedMilliseconds; }