include some functions to improve timer accuracy