Given a range of values how to time certain values within the range

Thanks for your quick reply, I will check how I can implement yor suggestion and let you know how it turns out. What are code tags?