Hi,
I am wandering what kind of performance impact set_task has on server, and same about register_think? Namely, recently I have found out that set_task checks every frame whether some task is comepleted or not, which in most cases ammounts to ton of unnecessary CPU load, since at least with me, in most cases when I use set_task (not all, but most), I really don't mind whether it is 0.3, 0.5 sec time difference if it is going to save considerable CPU usage.
For example, when I check amx_gag plugin by xPaw & Exolent, I see that they use following to check if gag is to expire:
PHP Code:
g_iThinker = create_entity( "info_target" );
entity_set_string( g_iThinker, EV_SZ_classname, szClassName );
register_think( szClassName, "FwdThink" );
While for me it looks more logical and easy to use set_task for that (its very unlikely to have more then 10 active gags at the same time, thus maximum 10 tasks in total), even tho in general, both approaches look too inneficient for me, since it really wouldn't matter if gag was to expire even few seconds later, or even few seconds earlier then planned (who cares if 2 minutes are in fact 121 sec) - I hope you get my meaning.
Second part of the question is how often (times per second or similar) is mentioned "info_target think" called?
Another thing that would be very helpful for people is some indebth explanation of how things work, since I did read basic tutorials and worked in pawn for years, and only by accident did I get to partial explanation how set_task works, which if I knew earlier I would handle many things way differently.
Thank you in advanced for your time