benchmarks/scenarios/ember.js
function _instrumentStart(name, _payload) {
    var listeners = cache[name];

    if (!listeners) {
      listeners = populateListeners(name);
    }

    if (listeners.length === 0) {
      return;
    }

    var payload = _payload();

    var STRUCTURED_PROFILE = _emberMetalCore.default.STRUCTURED_PROFILE;
    var timeName;
    if (STRUCTURED_PROFILE) {
      timeName = name + ': ' + payload.object;
      console.time(timeName);
    }

    var l = listeners.length;
    var beforeValues = new Array(l);
    var i, listener;
    var timestamp = time();
    for (i = 0; i < l; i++) {
      listener = listeners[i];
      beforeValues[i] = listener.before(name, timestamp, payload);
    }

    return function _instrumentEnd() {
      var i, l, listener;
      var timestamp = time();
      for (i = 0, l = listeners.length; i < l; i++) {
        listener = listeners[i];
        if (typeof listener.after === 'function') {
          listener.after(name, timestamp, payload, beforeValues[i]);
        }
      }

      if (STRUCTURED_PROFILE) {
        console.timeEnd(timeName);
      }
    };
  }
function _instrumentStart(name, _payload) {
    var listeners = cache[name];

    if (!listeners) {
      listeners = populateListeners(name);
    }

    if (listeners.length === 0) {
      return;
    }

    var payload = _payload();

    var STRUCTURED_PROFILE = _emberMetalCore.default.STRUCTURED_PROFILE;
    var timeName;
    if (STRUCTURED_PROFILE) {
      timeName = name + ': ' + payload.object;
      console.time(timeName);
    }

    var l = listeners.length;
    var beforeValues = new Array(l);
    var i, listener;
    var timestamp = time();
    for (i = 0; i < l; i++) {
      listener = listeners[i];
      beforeValues[i] = listener.before(name, timestamp, payload);
    }

    return function _instrumentEnd() {
      var i, l, listener;
      var timestamp = time();
      for (i = 0, l = listeners.length; i < l; i++) {
        listener = listeners[i];
        if (typeof listener.after === 'function') {
          listener.after(name, timestamp, payload, beforeValues[i]);
        }
      }

      if (STRUCTURED_PROFILE) {
        console.timeEnd(timeName);
      }
    };
  }
function _instrumentStart ( name , _payload ) { var listeners = cache [ name ] ; if ( ! listeners ) { listeners = populateListeners ( name ) ; } if ( listeners . length === 0 ) { return ; } var payload = _payload ( ) ; var STRUCTURED_PROFILE = _emberMetalCore . default . STRUCTURED_PROFILE ; var timeName ; if ( STRUCTURED_PROFILE ) { timeName = name + ': ' + payload . object ; console . time ( timeName ) ; } var l = listeners . length ; var beforeValues = new Array ( l ) ; var i , listener ; var timestamp = time ( ) ; for ( i = 0 ; i < l ; i ++ ) { listener = listeners [ i ] ; beforeValues [ i ] = listener . before ( name , timestamp , payload ) ; } return function _instrumentEnd ( ) { var i , l , listener ; var timestamp = time ( ) ; for ( i = 0 , l = listeners . length ; i < l ; i ++ ) { listener = listeners [ i ] ; if ( typeof listener . after === 'function' ) { listener . after ( name , timestamp , payload , beforeValues [ i ] ) ; } } if ( STRUCTURED_PROFILE ) { console . timeEnd ( timeName ) ; } } ; }
private for now
private for now