Reputation: 35
I need a way to check how many times a function is called in a second. I need to see in 1 second how many times it gets called. How I can do that? I saw tricks about how many times is called.. what I need is how many times is called in 1 second or 5 second
I have an online game, and cheaters did damage speed hacks... The function is called CCharacter::Attack
, I need to count how many times per second a normal player can call this function.. based on his character status. And the count how many times per second a hacker call ::Attack
Upvotes: 3
Views: 296
Reputation: 418
You would need two things:
Good luck implementing this. Please post the result, this might be very interesting for other people, too!
Upvotes: 0
Reputation: 1223
If N runs of your func take K seconds, you can calculate "number of time func is called in 1 second" by dividing result=N/K
or in 5 sec result5 = 5*N/K
Upvotes: 1