title: OpenLayers measure map rendering time
body: <p>I am using OpenLayers version 3 (answers with ver 2 are also OK) and want to measure how long it takes to render the vector layer. So, I have a vector layer with features:</p>
  
  <pre><code>var vectorLayer = new ol.layer.Vector({
      source: vectorSource
  });
  </code></pre>
  
  <p>And my map object:</p>
  
  <pre><code>var map = new ol.Map({
          renderer: 'canvas',
          target: document.getElementById('map'),
          view: new ol.View({
              center: [550000, 6520000],
              resolution: 500,
              minZoom: 1,
              maxZoom: 10,
              zoom: 1,
              resolutions: [500.0, 250.0, 125.0, 62.5, 31.25, 15.625, 7.8125, 3.90625, 1.953125, 0.9765625, 0.48828125],
              projection: projection
          })
      });
  </code></pre>
  
  <p>I want to measure how long it takes to render all features from the layer. If I do like this</p>
  
  <pre><code> var start=performance.now();
   map.addLayer(vectorLayer);
   var time=performance.now()-start;
   console.log(time)
  </code></pre>
  
  <p>then I see time in console much much earlier than points on map. I want to see the time right after all points are rendered. How can I do that?</p>