in reply to Foreach Loop Optimization
You could replace lines 11/12 with
$localtime = $moduleField[2] ? FormatTime($moduleField[2]) : "n/a";and also put your printout data into a variable and only print once per loop iteration instead of every time you want to add output. But I have a hunch that those changes will hardly matter and the real timewaster in this loop is the FormatTime subroutine (which you haven't shown us). I suggest using DevelDProf to find out what your code spends most of its time doing.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Foreach Loop Optimization
by upallnight (Sexton) on Aug 01, 2007 at 15:57 UTC | |
by johngg (Canon) on Aug 01, 2007 at 16:34 UTC | |
by ikegami (Patriarch) on Aug 01, 2007 at 16:17 UTC |