namespace FNZCM.BlazorWasm.Helpers { public static class TimeoutHelper { public static void SetTimeout(int ms, params Func[] actions) { int index = 0; var t = new System.Timers.Timer(ms); t.Elapsed += async delegate { t.Stop(); try { await actions[index]?.Invoke(); } finally { ++index; if (index >= actions.Length) { t.Stop(); t.Dispose(); t = null; } else { t.Start(); } } }; t.Start(); } } }