Added methods to track the beginning and ending of rendering to support async rendering