Hi.
I would like the Sub LongProcess to be executed SIMULTANEOUSLY, ie the 3 processes beginning and ending at the same time.
As it is in the code, they start together, but the second only ends after the end of the first, and the third after the end of the second.
Can anyone help?
log:
I would like the Sub LongProcess to be executed SIMULTANEOUSLY, ie the 3 processes beginning and ending at the same time.
As it is in the code, they start together, but the second only ends after the end of the first, and the third after the end of the second.
Can anyone help?
B4X:
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
LongProcess(0)
LongProcess(1)
LongProcess(2)
End Sub
Sub LongProcess(ix As Int)
Log("start time: " & ix & " " & DateTime.Time(DateTime.Now))
Sleep(0)
For x = 1 To 300000000
Next
Log("end time: " & ix & " " & DateTime.Time(DateTime.Now))
End Sub
log:
Waiting for debugger to connect...
Program started.
start time: 0 12:13:41
start time: 1 12:13:41
start time: 2 12:13:41
end time: 0 12:13:42
end time: 1 12:13:44
end time: 2 12:13:46