[Tutorial] Benchmarking
#19

Quote:
Originally Posted by GrimR
View Post
pawn Code:
enum pData
{
  Float: pHealth,
  Float: pArmor,
         pName[MAX_NAME],
  pSex,
  pAge,
  pAcc,
  pConnected,  // Keep track of if this ID is connected.
  pExp,
  pMoney,
  pBank
};

new  pInfo[500][pData];
I'm just trying to test how pInfo[playerid][pConnected] would go up against IsPlayerConnected() with a loop and check. The 500 was just to test if MAX_PLAYERS was somehow an issue.

pawn Code:
new j = 0;

  START_BENCH( 499 );
  {
    if (pInfo[j][pConnected]) {}
    j++;
  }
  FINISH_BENCH( "My Test" );
It just doesn't do anything. If I replace it with IsPlayerConnected(j) instead, it spits out what it should. No compilation errors, or run time errors etc.
The parameter in START_BENCH is the time it should be benchmarked (in milliseconds). The code inside the benchmark should run once independently, not taking in account previous repetitions.
Proper usage in this case would be:
pawn Code:
START_BENCH( 1000 );
{
    for (new j = 0; i < MAX_PLAYERS; j++) {
        if (pInfo[j][pConnected]) {}
    }
}
FINISH_BENCH( "My Test" );
Reply


Messages In This Thread
Benchmarking - by Slice - 30.01.2011, 10:11
Re: Benchmarking - by SlashPT - 30.01.2011, 10:16
Re: Benchmarking - by iMonk3y - 30.01.2011, 11:04
Re: Benchmarking - by On_Top_Non_Stop - 05.02.2011, 19:36
Re: Benchmarking - by MrDeath537 - 05.02.2011, 22:41
AW: Benchmarking - by Nero_3D - 05.02.2011, 22:45
Re: Benchmarking - by legodude - 06.02.2011, 08:41
Re: Benchmarking - by JaTochNietDan - 06.02.2011, 08:52
Re: Benchmarking - by legodude - 06.02.2011, 08:52
Re: Benchmarking - by JaTochNietDan - 06.02.2011, 08:53
Re: Benchmarking - by [03]Garsino - 06.02.2011, 08:53
Respuesta: Benchmarking - by luis_lpv_22 - 06.02.2011, 10:57
Re: Benchmarking - by MadeMan - 06.02.2011, 11:16
Re: Benchmarking - by Slice - 06.02.2011, 15:03
Re: Benchmarking - by Lorenc_ - 13.10.2011, 10:28
Re: Benchmarking - by GrimR - 18.10.2011, 09:02
Re: Benchmarking - by Slice - 18.10.2011, 09:40
Re: Benchmarking - by GrimR - 18.10.2011, 09:43
Re: Benchmarking - by Slice - 18.10.2011, 10:30
Re: Benchmarking - by GrimR - 18.10.2011, 10:35
Re: Benchmarking - by Slice - 18.10.2011, 10:58
Re: Benchmarking - by GrimR - 18.10.2011, 11:11
Re: Benchmarking - by GrimR - 18.10.2011, 22:26
Re: Benchmarking - by Slice - 31.10.2011, 17:48
AW: Benchmarking - by Nero_3D - 31.10.2011, 19:38
Re: Benchmarking - by TheArcher - 14.11.2011, 12:24
Re: Benchmarking - by Yousha_Aleayoub - 18.11.2012, 12:23
Re: Benchmarking - by ||123|| - 27.11.2013, 09:35
Re: Benchmarking - by Emmet_ - 27.11.2013, 10:11
Re: Benchmarking - by newbie scripter - 27.11.2013, 10:18
Re: Benchmarking - by Emmet_ - 27.11.2013, 10:20
Re: Benchmarking - by Sublime - 27.11.2013, 10:26
Re: Benchmarking - by ||123|| - 28.11.2013, 11:40
Re: Benchmarking - by AndreiWow - 30.01.2017, 22:11

Forum Jump:


Users browsing this thread: 3 Guest(s)