time manager code