Code is executing very slow while in standalone, but it is executing fast in IDE

Hi,

I am using arduino uno r3 atmega328 with gsm shield.

My sketch is executing very fast(in seconds) from IDE (Serial monitor).
But, it is executing extremely slow(takes 30 minutes) when it is standalone.
Can you please help me to solve the issue.