Added timer code so I don't have to rely on other libraries. Is not yet complete