Leadtools.Dicom.AddIn Namespace > AsyncResult Class : Wait Method |
public bool Wait( int milliseconds )
'Declaration Public Function Wait( _ ByVal milliseconds As Integer _ ) As Boolean
'Usage Dim instance As AsyncResult Dim milliseconds As Integer Dim value As Boolean value = instance.Wait(milliseconds)
public bool Wait( int milliseconds )
function Leadtools.Dicom.AddIn.AsyncResult.Wait( milliseconds )
public: bool Wait( int milliseconds )
Private Sub ThreadFunction() For i As Integer = 0 To 999 Console.WriteLine("Count: {0}", i) Next i End Sub Public Sub TestExecute() Dim r As AsyncResult = AsyncHelper.Execute(New Action(AddressOf ThreadFunction)) ' ' Wait 1 second for the thread to finish. ' r.Wait(1000) If r.IsCompleted Then Console.WriteLine("Completed") End If End Sub
private void ThreadFunction() { for (int i = 0; i < 1000; i++) { Console.WriteLine("Count: {0}", i); } } public void TestExecute() { AsyncResult r = AsyncHelper.Execute(new Action(ThreadFunction)); // // Wait 1 second for the thread to finish. // r.Wait(1000); if (r.IsCompleted) Console.WriteLine("Completed"); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2