Could you give some examples of a “couple lines of code” that takes minutes?
Because either you’re referring to a loop, like /u/Schnutzel refers to below, or the code is itself just a call into some much much more complicated code which is much longer than a couple lines.
Latest Answers