Cant u use a library function or something of create ur delay?
If the delays are taking place simultaneously then call the common delay and then the delay of the ball which requires a longer delay.
eg)
If u have ball A with delay 5 s and ball B with delay 8s and their delays start at the same time then call a 5s delay function and then the 3s delay function
Hope this helps...
Piyush