Changed heap allocation to stack

Changed timer from a heap-based allocation to stack-based.