timer: add time management functions