Added function to getting time.