using System; public class Test { public static int Ret() { throw new ApplicationException(); } public static void Main() { DateTime fin = DateTime.Now.AddSeconds(3); int i = 0; while (DateTime.Now < fin) { try { Ret(); } catch { } i++; } Console.WriteLine("{0} times", i); } }