Raised This Month: $ Target: $400
 0% 

Which method is more efficient ? Task vs Each time check


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hamartia
Member
Join Date: Oct 2015
Old 05-25-2016 , 09:45   Re: Which method is more efficient ? Task vs Each time check
Reply With Quote #4

Thank you for checking it and giving your opinion.

@Black Rose I used the bool because I thought why to use a comparison check since the method above will be called numerous times when the player selects grenade and presses fire button (because it wont allow you to throw and the hook is gonna be called again). After the x seconds, that condition will be true for that round, so used a boolean.

@fysiks Yes exactly! It totally depends up on what am trying to do. Sorry that I didn't explain that. Why I asked this question is because this hook is going to be called numerous times on using grenade and wanted to know whether the calculation is worth of prevent a set_task. I ll edit the question.

I do understand that I might be making the usual mistake: Over optimization. Hence wanted your views.
__________________

Last edited by Hamartia; 05-25-2016 at 09:46.
Hamartia is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode