Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MAX_LOOPS 1000000
- main() { }
- public OnGameModeInit()
- {
- new
- i=0,k=0,
- x[4];
- x[0] = GetTickCount();
- for( i = 0 ; i != MAX_LOOPS ; i++)
- {
- k=0;
- while(k!=MAX_PLAYERS)
- {
- k++;
- }
- }
- x[1] = GetTickCount();
- for( i = 0 ; i != MAX_LOOPS ; i++)
- {
- for( k=0 ; k !=MAX_PLAYERS;k++)
- {
- }
- }
- x[2] = GetTickCount();
- for( i = 0 ; i != MAX_LOOPS ; i++)
- {
- k=0;
- do
- {
- k++;
- }
- while(k!=MAX_PLAYERS);
- }
- x[3] = GetTickCount();
- printf(" while Loop %04dms", x[1] - x[0] );
- printf(" for Loop %04dms", x[2] - x[1] );
- printf(" do while %04dms", x[3] - x[2] );
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement