Timer class rewritten

updated the code to work more efficient and use less resources