Is it correct that the function executes one after another, and not in multiple threads?
AmiVar VTest3(int NumArgs, AmiVar* ArgsTable)
{
int nRange = (int)ArgsTable[0].val;
char buffer[100];
srand(time(NULL));
AmiVar result;
result = gSite.AllocArrayResult();
sprintf_s(buffer, "Tempc++ %d start", nRange);
OutputDebugStringA(buffer);
//do some work
for (int i = 0; i < 30000000; i++)
{
int x = rand() % 999999901 + 10000;
}
sprintf_s(buffer, "Tempc++ %d end", nRange);
OutputDebugStringA(buffer);
result.type = VAR_FLOAT;
result.val = 1;
return result;
}
|20:49:40.202|newbar1|
|20:49:40.202|Tempc++ 1 start|
|20:49:40.202|newbar6|
|20:49:40.203|newbar5|
|20:49:40.203|newbar3|
|20:49:40.204|newbar4|
|20:49:40.204|newbar2|
|20:49:41.264|Tempc++ 1 end|
|20:49:41.264|Tempc++ 6 start|
|20:49:42.330|Tempc++ 6 end|
|20:49:42.330|Tempc++ 5 start|
|20:49:43.434|Tempc++ 5 end|
|20:49:43.434|Tempc++ 3 start|
|20:49:44.501|Tempc++ 3 end|
|20:49:44.501|Tempc++ 4 start|
|20:49:45.578|Tempc++ 4 end|
|20:49:45.578|Tempc++ 2 start|
|20:49:46.651|Tempc++ 2 end|