Retiring world number one Ashleigh Barty says that the time was right for her to leave the sport and that she has no regrets.