This is the bit where DoWork1, DoWork2 and DoWork3 are called async (in parallel on different threads), see 4th argument of CallAsync command.
In this case, DoWork1 has num1=1000, DoWork2 has num2=2000 and DoWork3 has num3=3000.
So DoWork1 is fastest, and DoWork3 slowest.
As DoWork1 finishes, the current state is that total1 = 250500250000 (just finished), and total2 and total3 have made similar progress, but not completed.
As DoWork2 finishes, the current state is that total1 = 250500250000 (unchanged), total2 = 4004001000000 (just finished), and total3 still going.
Finally, as DoWork3 finishes, all 3 totals are completed.
Code:
LDCall.CallAsync("litdev.dll","litdev","ldcall","function","1=DoWork1;2=1000;")
LDCall.CallAsync("LitDev.dll","LitDev","LDCall","Function","1=DoWork2;2=2000;")
TextWindow.WriteLine(LDCall.CallAsync("","","","DoWork3",""))
In this case, DoWork1 has num1=1000, DoWork2 has num2=2000 and DoWork3 has num3=3000.
So DoWork1 is fastest, and DoWork3 slowest.
As DoWork1 finishes, the current state is that total1 = 250500250000 (just finished), and total2 and total3 have made similar progress, but not completed.
As DoWork2 finishes, the current state is that total1 = 250500250000 (unchanged), total2 = 4004001000000 (just finished), and total3 still going.
Finally, as DoWork3 finishes, all 3 totals are completed.