implemented timer using timeSetEvent and Heap functions