Is my logic correct ?
No.
By declaring the variable currentMillis at the start of every loop you reset it. Therefore you will never see it time out.
Is my logic correct ?
No.
By declaring the variable currentMillis at the start of every loop you reset it. Therefore you will never see it time out.