Yra kažkoks soft'as AlliedModuose.
EDIT:
http://forums.alliedmods.net/showthread.php?t=67752
EDIT2: Nu pratestavau, tai kaip suprantu
arrayset() - ultimate metodas tokiems dalykams. Su 32 vietų masyvu, paprastas ciklas užtruko mažiau nei 0.000001, o
arrayset() - 0.000001. Bet su didesniu masyvu -
arrayset() trunka nesveikai mažai. Lieku prie varianto naudot
arrayset(), kai tik galima.
Code: Select all
#include <amxmodx> new bool:Small[32];new bool:Big[10000]; public plugin_init(){ TestSmall(); TestBig(); arrayset(Small, true, sizeof Small); arrayset(Big, true, sizeof Big);} TestSmall() for (new i; i < sizeof Small; i++) Small[i] = true; TestBig() for (new i; i < sizeof Big; i++) Big[i] = true;
Code: Select all
type | name | calls | time / min / max------------------------------------------------------------------- n | arrayset | 2 | 0.000001 / 0.000000 / 0.000001 p | plugin_init | 1 | 0.000001 / 0.000001 / 0.000001 f | TestSmall | 1 | 0.000000 / 0.000000 / 0.000000 f | TestBig | 1 | 0.000046 / 0.000046 / 0.0000460 natives, 0 public callbacks, 1 function calls were not executed.