/// <summary> /// Creates and starts a new asynchronous <c>DelayedCall</c> instance. The callback function will be invoked on a <c>ThreadPool</c> thread. /// </summary> /// <param name="cb">Callback function</param> /// <param name="milliseconds">Time to callback invocation</param> /// <returns>Newly created <c>DelayedCall</c> instance that can be used for later controlling of the invocation process</returns> public static DelayedCall StartAsync(Callback cb, int milliseconds) { DelayedCall dc = CreateAsync(cb, milliseconds); if (milliseconds > 0) { dc.Start(); } else if (milliseconds == 0) { dc.FireNow(); } return(dc); }
public static DelayedCall StartAsync(DelayedCall.Callback cb, int milliseconds) { DelayedCall delayedCall = DelayedCall.CreateAsync(cb, milliseconds); if (milliseconds > 0) { delayedCall.Start(); } else if (milliseconds == 0) { delayedCall.FireNow(); } return(delayedCall); }