A lustful thought passing through your mind is not an occassion of sin. DWELLING on that thought is sinful.
How long can the thought be before it turns into a DWELLING?