[Benchmark] strpack vs format
#4

Shouldn't you re-fetch StartTick after the first code executes? If not, aren't you taking the time it takes for format AND strpack to execute (aka when the server started), which is not what you want. You want the time each section of code took to execute. I did that and got this:

Код:
format: 319 ms
strpack: 137 ms
pawn Код:
#include <a_samp>

main()
{
    new
        StartTick,
        StopTick,
        string[16],
        string2[16];

    format(string2, 17, "I like big butts");
    StartTick = GetTickCount();
    for(new i; i < 1000000; i++)
    {
        format(string, 17, string2);
    }
    StopTick = GetTickCount();
    printf("format: %d ms", StopTick-StartTick);
    StartTick = GetTickCount();
    for(new i; i < 1000000; i++)
    {
        strpack(string, string2, 17);
    }
    StopTick = GetTickCount();
    printf("strpack: %d ms", StopTick-StartTick);
    return 1;
}
Reply


Messages In This Thread
[Benchmark] strpack vs format - by Lenny the Cup - 05.04.2011, 19:46
Re: [Benchmark] strpack vs format - by WackoX - 05.04.2011, 19:49
Re: [Benchmark] strpack vs format - by Placebo - 05.04.2011, 19:50
Re: [Benchmark] strpack vs format - by randomkid88 - 05.04.2011, 20:20
Re: [Benchmark] strpack vs format - by Lenny the Cup - 05.04.2011, 20:38
AW: [Benchmark] strpack vs format - by Nero_3D - 05.04.2011, 20:43
Re: AW: [Benchmark] strpack vs format - by randomkid88 - 05.04.2011, 20:55
Re: [Benchmark] strpack vs format - by Lenny the Cup - 05.04.2011, 21:13
AW: [Benchmark] strpack vs format - by Nero_3D - 05.04.2011, 21:38

Forum Jump:


Users browsing this thread: 3 Guest(s)