Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main()
- {
- for(new a; a < 5; a++) testA();
- }
- enum eoxoA
- {
- participant[2]
- }
- new oxoA[MAX_PLAYERS / 2][eoxoA];
- enum pItem
- {
- oxoID
- }
- new pInfo[MAX_PLAYERS][pItem];
- stock testA()
- {
- new gt, c, playerid = 20;
- gt = GetTickCount();
- for(c = 0; c < 10000000; c++)
- {
- new id, oxo_id;
- oxo_id = pInfo[playerid][oxoID];
- if(oxoA[oxo_id][participant][0] == playerid)
- {
- id = oxoA[oxo_id][participant][1];
- }
- else
- {
- id = oxoA[oxo_id][participant][0];
- }
- SetPlayerHealth(id, 100.0);
- }
- printf("1. %dMS" , GetTickCount() - gt);
- gt = GetTickCount();
- for(c = 0; c < 10000000; c++)
- {
- new id = oxoA[pInfo[playerid][oxoID]][participant][0] == playerid ? 1 : 0;
- SetPlayerHealth(oxoA[pInfo[playerid][oxoID]][participant][id], 100.0);
- }
- printf("2. %dMS" , GetTickCount() - gt);
- gt = GetTickCount();
- for(c = 0; c < 10000000; c++)
- {
- SetPlayerHealth(oxoA[pInfo[playerid][oxoID]][participant][0] == playerid ? oxoA[pInfo[playerid][oxoID]][participant][1] : oxoA[pInfo[playerid][oxoID]][participant][0], 100.0);
- }
- printf("3. %dMS" , GetTickCount() - gt);
- }
- /*
- 1. 1922MS, 1936MS, 1944MS, 1952MS, 2006MS
- 2. 1984MS, 1987MS, 1995MS, 1976MS, 2028MS
- 3. 1995MS, 1998MS, 1999MS, 2000MS 2100MS
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement