Your code is too hard to read without tags, but I'd probably just use a timer.