The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling functions from my player event file: Performance
Author Message
Murmur
Apprentice
*

Posts: 33
Likes Given: 3
Likes Received: 2 in 2 posts
Joined: Feb 2013
Reputation: 0



Post: #1
Calling functions from my player event file: Performance
So I created a custom @HitTry code, it's pretty long, probably 200 lines of code, just a bunch of IF statements. The code works great. I have it set up so that if I have 200 dex, I swing weapons like a madman, like 5-10 hits per second.

Then I need to work on another part of @HitTry (my chance to hit regarding Tactics skill) and I put all my code for my swingspeed into a FUNCTION, and went ahead and tested it before I started coding anything more, and I found that instead of swinging like 5-10 times a second, I swing like 1 time a second.

So my question is about performance using functions, is there any reason that the exact same code being called from a FUNCTION would run slower that if it wasn't in function?

I would never have guessed it would, anyone have any ideas?

Thanks,
-Murmur

*you glance to your left to a region you just surveyed... you glimpse a magical being, more shadow than substance, caught midway in transformation... the figure smiles, the corners of his mouth jut upwards slightly on the edges, suddenly stretched to a length not at all human...*
(This post was last modified: 05-08-2017 08:42 AM by Murmur.)
05-08-2017 08:41 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Calling functions from my player event file: Performance - Murmur - 05-08-2017 08:41 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)