MainAcitivty: Improve the Timing

Now the application didn't sleep for 1 sec. The application now waits if there
are one second over.