/try help ASAP
#11

Quote:
Originally Posted by TheCrazyKiller
Посмотреть сообщение
no point.. for a cmd like this..

isnull and zcmd is the fastest way i see it
Actually, it ain't noticeable at all... test yourself, gives the same result's.

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Again your missing case 1. And random(3) will give 4 cases not 3 (cases 0, 1, 2, 3). If he is comfortable using sscanf there is no problem using that for null checks its not exactly insanely inefficient. Nor is it slow.
Like i just mentioned, you wont notice it at all.

pawn Код:
// With SSCANF

new Cmdstring[30] = "imastringok?testingsomeshit";

public OnGameModeInit()
{
    new Tick = GetTickCount();
    new sscanfstring[30];
    sscanf(Cmdstring, "s[30]", sscanfstring);
    switch(random(3))
    {
        case 0: { printf("1"); }
        case 1: { printf("2"); }
        case 2: { printf("3"); }
    }
    printf("%d", GetTickCount()-Tick);
    printf("%s", sscanfstring);
    return 1;
}
pawn Код:
// Without SScanf

new Cmdstring[30] = "imastringok?testingsomeshit";

public OnGameModeInit()
{
    new Tick = GetTickCount();
    switch(random(3))
    {
        case 0: { printf("1"); }
        case 1: { printf("2"); }
        case 2: { printf("3"); }
    }
    printf("%d", GetTickCount()-Tick);
    printf("%s", Cmdstring);
    return 1;
}
pawn Код:
//SScanf 1-1-0
//W/O SScanf 0-1-1
Reply


Messages In This Thread
/try help ASAP - by Luis- - 19.10.2010, 20:57
Re: /try help ASAP - by Cameltoe - 19.10.2010, 20:59
Re: /try help ASAP - by iggy1 - 19.10.2010, 21:00
Respuesta: /try help ASAP - by The_Moddler - 19.10.2010, 21:06
Re: /try help ASAP - by Luis- - 19.10.2010, 21:09
Re: /try help ASAP - by iggy1 - 19.10.2010, 21:12
Re: /try help ASAP - by Cameltoe - 19.10.2010, 21:16
Respuesta: /try help ASAP - by The_Moddler - 19.10.2010, 21:37
Re: /try help ASAP - by Cameltoe - 19.10.2010, 21:50
Re: /try help ASAP - by iggy1 - 19.10.2010, 21:52
Re: /try help ASAP - by Cameltoe - 19.10.2010, 22:05
Respuesta: Re: /try help ASAP - by The_Moddler - 19.10.2010, 22:14

Forum Jump:


Users browsing this thread: 1 Guest(s)