Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ---
- strlens: 26, strlen_chat: 25, strlen: 26
- strlens: 21 ms
- strlen_chat: 40 ms
- strlen: 2 ms
- Filterscript 'ap.amx' loaded.
- --
- */
- public OnFilterScriptInit()
- {
- printf("strlens: %d, strlen_chat: %d, strlen: %d", strlens("IgrexolonO jak brat z wsrh"), strlen_chat("IgrexolonO jak brat z wsrh"), strlen("IgrexolonO jak brat z wsrh"));
- new tick = GetTickCount();
- for(new i;i<10000;i++) strlens("IgrexolonO jak brat z wsrh");
- printf("strlens: %d ms", GetTickCount() - tick);
- tick = GetTickCount();
- for(new i;i<10000;i++) strlen_chat("IgrexolonO jak brat z wsrh");
- printf("strlen_chat: %d ms", GetTickCount() - tick);
- tick = GetTickCount();
- for(new i;i<10000;i++) strlen("IgrexolonO jak brat z wsrh");
- printf("strlen: %d ms", GetTickCount() - tick);
- return 1;
- }
- stock strlens(const buffer[])
- {
- new i;
- while(++i,buffer[i] != EOS) {}
- return i;
- }
- strlen_chat(buffer[])
- {
- for(new i;i<128;i++)
- {
- if(buffer[i] == 0x0) return i-1;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement