01.07.2011, 15:55
(
Последний раз редактировалось mk124; 06.04.2016 в 13:49.
)
Has moved to: https://sampforum.blast.hk/showthread.php?tid=397735
A suggestion on optimization, initialize all amx_FindFunction(***) pointers in initialization and CACHE them so they aren't always looked up on each native calls, but are known in advance.
|
is that really the only way to set a vehicles numberplate on spawn!?
|
long lastTick = System.nanoTime(); // Put the code you want to count time long time = System.nanoTime() - lastTick; System.out.println( "Java: " + time/1000/1000 + " ms." );
new lastTick = GetTickCount(); // Put the code you want to count time new Time = GetTickCount() - lastTick; printf( "Pawn: %d ms.", Time );
for( int i=0; i<1000000; i++ ) this.allowAdminTeleport(true);
for( new i=0; i<1000000; i++ ) AllowAdminTeleport(1);
for( int i=0; i<100000; i++ ) this.setGameModeText( "Shoebill" );
for( new i=0; i<100000; i++ ) SetGameModeText( "Shoebill" );
boolean isPrime( int num ) { int divisor = 3, limit = num; if( num%2 == 0 ) return false; while( limit > divisor ) { if( num%divisor == 0 ) return false; limit = num / divisor; divisor += 2; } return true; } for( int i=0; i<100; i++ ) isPrime(2147483647);
isPrime( num ) { new divisor = 3, limit = num; if( num%2 == 0 ) return 0; while( limit > divisor ) { if( num%divisor == 0 ) return 0; limit = num / divisor; divisor += 2; } return 1; } for( new i = 0; i < 100; i++ ) isPrime(2147483647);