11.09.2011, 02:28
HI guys,
I've recently tested a code
it was to see which is better
I followed ******' string optimisation thread
that i made i test with
new str[12 char]
vs
new string[12]
But i deleted the code after tested and also the result
luckily i can still remember it(partially)
The result is: Time 1: 2900 Something Time 2: 2800 Something
but thats not the point, the point is time 1 which is a packed string has more time than time 2.
I'm not sure which is better + Did it count the time to finish all printf's or did it count the time it has been printed?
I've recently tested a code
it was to see which is better
I followed ******' string optimisation thread
that i made i test with
new str[12 char]
vs
new string[12]
pawn Код:
#define ITERATIONS (10000)
Test()
{
new
t0,
t1,
t2,
i;
t0 = GetTickCount();
for (i = 0; i < ITERATIONS; i++)
{
new str[12 char] = !"Hello there";
printf(str);
}
t1 = GetTickCount();
for (i = 0; i < ITERATIONS; i++)
{
new string[12] = "Hello there";
printf(string);
}
t2 = GetTickCount();
printf("Time 1: %04d, time 2: %04d", t1 - t0, t2 - t1);
}
luckily i can still remember it(partially)
The result is: Time 1: 2900 Something Time 2: 2800 Something
but thats not the point, the point is time 1 which is a packed string has more time than time 2.
I'm not sure which is better + Did it count the time to finish all printf's or did it count the time it has been printed?