View Single Post
03-08-09, 04:47 PM   #7
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
It may not be code-independant, depending on what you're doing in your code. If, for example, you're calling a function to get a value that never changes for every iteration in a loop - that could be optimized by assigning the returned value to a local variable exactly once and using it in the iterations.

If you're asking how to delay execution for 0.05 seconds, that depends on what you're doing - is delaying really what you want to do, or would an optimization or two remove the CPU spikes and allow the code to otherwise run as-is?
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote