Schedule agent taking more time than menu triggered agent?

Hi we are triggering schedule agent it is taking more time to finish and with same code menu triggered agent is working bit faster any suggestions?

Subject: Could be several things.

Is the scheduled agent accessing data on the same server or another replica on another server?Is the local agent working against a local replica or a database on the server?

It also depends on what the code looks like, if you are performing view lookups it will probably take a litle bit longer if you try to do the lookup against a frequently updated/modified view on the server vs a local replica that does not need to update the view index before returning a document collection.

Just one example. It all depends on your code. Post it and let us look at it.

Also, what tool do you use to profile your code and time the different parts?