You can add JavaScript events to occur before and after a map layer is loaded:
The Embedded JavaScript tab opens with a template for your JavaScript function.
Every time a layer is ready, meaning that the layer has all its graphics, the event geometry-complete is fired. The afterload event fires when geometry-complete has fired as many times as there are data layers in the application. The load event fires after base maps and the first layer (if it exists) have been added to the map (not drawn, just added).
There is a time gap between the time the afterload event fires and when you actually see the layer in the map. This time gap is related to the time the map takes to render the layer. So the layer is already in the map, but it has not rendered yet. There is no event that will fire after the layer is finished rendering in the map.