08.02.2017, 18:58
I am using a while loop to search in a array, with strfind... e.g:
Command:
Basically that runs the loop until we're at MAX_MESSAGES, but breaks if we found what we're looking for.
I have approx 330 messages (MAX_MESSAGES), using that cmd, it takes around 3-4 second to get response, is it cuz of while, strfind or something else?
PHP Code:
new myarray[MAX_MESSAGES][7][1000] =
{
{"hey", "Hello, how are"},
{"hi", "Hello , how are "}
};
PHP Code:
while(count != MAX_MESSAGES)
{
new Index = getIndex();
printf("%d",count);
count++;
printf("%d",Index);
if(strfind(myarray[Index][0], text, true)!=-1)
{
printf("Found it");
k = Index;
found = true;
break;
}
else
{
printf("didnt find it");
found = false;
}
}
I have approx 330 messages (MAX_MESSAGES), using that cmd, it takes around 3-4 second to get response, is it cuz of while, strfind or something else?