PHP Code:
/*
* Loop for the specified waiting period, generating and evaluating
* replies
*/
max_surprise=(float)-1.0;
count=0;
basetime=time(NULL);
/* progress("Generating reply", 0, 1); */
do {
replywords=reply(model, keywords);
surprise=evaluate_reply(model, keywords, replywords);
++count;
if((surprise>max_surprise)&&(dissimilar(words, replywords)==TRUE)) {
max_surprise=surprise;
output=make_output(replywords);
}
/* progress(NULL, (time(NULL)-basetime),timeout); */
} while((time(NULL)-basetime)<timeout);
"Loop for the specified waiting period"
That's the issue. It seems it forces the loop to run until 1 second elapsed to simulated a waiting time?
You can't do that in HLDS, it's single-threaded, it's going to block everything else.
Remove the do/while, and if you need the waiting, use a task system.
__________________