Ever wanted to test how long a script you wrote takes to run, which method of two is faster, etc? So did I. Iocun gave me the idea, been using this for a bit now to streamline my code a bit to work better on slower machines. Anyone interested, give it a go. I tried to leave the code as unambiguous and easy to edit as anyone would like. Please, by all means, use it as you see fit.
Also, I find it fascinating that x ="5"*1 is almost twice as fast as x=tonumber("5"). Just throwing that out there.
Change iterations to how many times you want it to loop, change timelimit to when you want it to halt. The latter is a failsafe. Don't go ramping it up just to let it run fully. From there, just put your code between the designated comments and let it go. Depending on complexity, could need 10 iterations, could need a million.
1. Yes, I know this loops and tests time taken. Dear gods, don't ever put send() or sendAll() in this if you're connected to -any- server. Any code that will send to a server or somehow affect anything outside your machine shouldn't be used in this.
2. Yes, this will freeze Mudlet while it runs. That's the joy of looping inane amounts of code. It's not broken. If you reach the end of your timelimit time and it's still frozen... well, best take a look at what you sent through this, hadn't you?
3. Yes, if you put bad/broken code through this carelessly, it could freeze up quite nicely. If you lose reflexes because you failed to save, no pointing fingers at me. This is a tool, I wouldn't suggest a drunk man uses a hammer any faster.
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest