updated Timer so that it can also execute if elapsed and wait are equal