for eg, u say u want to go 30m for 20mins.
do u start counting your 20mins the moment u start to descend from surface?
or
the moment u touch 30m?
and when do u stop counting?
the moment u leave the 30m spot?
or when u reach 5m for safety stop?
or safety stop time also included in your 20mins?
thanks 
If you are simply logging your dive times, your 3 min safety stop is not included in the bottom time, but it is included in the total dive time. We typically descend a lot faster than we ascend, so the BT includes all the time we are descending plus the time until we reach the safety stop.
So if you have 20 min BT plus 3 min safety stop, your dive time is 23 min.
However, for calculating your PG after the dive, include those 3 min as a margin for safety. That is, calculate your PG on your total dive time, not just the bottom time.