Using
localtime(time) is fine, but note it's only 1-sec resolution (which is probably fine for your needs). If you ever need something better, use
Time::HiRes
I would highly recommend
Devel::Profile since it can tell you what subs/calls are the bottlenecks (you get this information from
Devel::Cover as well), and that is probablly the most robust way to debug your issues.
Lastly, an obligatory reminder to review your queries and schema/indices to make sure they are all appropriate.