• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Testing Script Efficiency

xKrazyx

Old School
Joined
Oct 23, 2012
Messages
904
Solutions
6
Reaction score
683
Could anyone share a good method to test a scripts efficiency when running multiple instances of that script?
For example... I want to know if I could run an onThink with 100 lines of code on every player online... Does it lag at 20 players? 100 players? 500 players?

or any other script that involves that sort of load/perfomance testing.
Benchmarking multiple instances I suppose..

whats a good method to test the server without the players?

Ive googled a few methods but i'd like to ask here as well :)

Thanks
 
at the top of the script you can save the current time it executes with a variable such as
Code:
 local time = os.mtime() -- saves current time in milliseconds
then at the end of your script you can use
Code:
 print(os.mtime() - time) -- current time - time saved (will print the millisecond difference)
 
Back
Top