background and 30 seconds

How to calculate 30 second?

Example:

- app calls, registerForTemporalEvent

- system calls BAG.onTemporalEvent

- in BAG.onTemporalEvent I call 5 times makeWebRequest(... onReceive)

- system calls BAG.onReceive

Is "30 second" time between onTemporalEvent and BAG.exit?

Is it possible to find out that system wants to kill BAG. For example I'm waiting for 5th respond but can send 4 if system wants to kill BAG.