src/utils/PerfUtils.js
function addMeasurement(id) {
        if (!enabled) {
            return;
        }

        if (!(id instanceof PerfMeasurement)) {
            id = new PerfMeasurement(id, id);
        }

        var elapsedTime = brackets.app.getElapsedMilliseconds();

        if (activeTests[id.id]) {
            elapsedTime -= activeTests[id.id].startTime;
            delete activeTests[id.id];
        }

        if (perfData[id]) {
            // We have existing data, add to it
            if (Array.isArray(perfData[id])) {
                perfData[id].push(elapsedTime);
            } else {
                // Current data is a number, convert to Array
                perfData[id] = [perfData[id], elapsedTime];
            }
        } else {
            perfData[id] = elapsedTime;
        }

        if (id.reent !== undefined) {
            if (_reentTests[id] === 0) {
                delete _reentTests[id];
            } else {
                _reentTests[id]--;
            }
        }

    }
function addMeasurement(id) {
        if (!enabled) {
            return;
        }

        if (!(id instanceof PerfMeasurement)) {
            id = new PerfMeasurement(id, id);
        }

        var elapsedTime = brackets.app.getElapsedMilliseconds();

        if (activeTests[id.id]) {
            elapsedTime -= activeTests[id.id].startTime;
            delete activeTests[id.id];
        }

        if (perfData[id]) {
            // We have existing data, add to it
            if (Array.isArray(perfData[id])) {
                perfData[id].push(elapsedTime);
            } else {
                // Current data is a number, convert to Array
                perfData[id] = [perfData[id], elapsedTime];
            }
        } else {
            perfData[id] = elapsedTime;
        }

        if (id.reent !== undefined) {
            if (_reentTests[id] === 0) {
                delete _reentTests[id];
            } else {
                _reentTests[id]--;
            }
        }

    }
function addMeasurement ( id ) { if ( ! enabled ) { return ; } if ( ! ( id instanceof PerfMeasurement ) ) { id = new PerfMeasurement ( id , id ) ; } var elapsedTime = brackets . app . getElapsedMilliseconds ( ) ; if ( activeTests [ id . id ] ) { elapsedTime -= activeTests [ id . id ] . startTime ; delete activeTests [ id . id ] ; } if ( perfData [ id ] ) { // We have existing data, add to it if ( Array . isArray ( perfData [ id ] ) ) { perfData [ id ] . push ( elapsedTime ) ; } else { // Current data is a number, convert to Array perfData [ id ] = [ perfData [ id ] , elapsedTime ] ; } } else { perfData [ id ] = elapsedTime ; } if ( id . reent !== undefined ) { if ( _reentTests [ id ] === 0 ) { delete _reentTests [ id ] ; } else { _reentTests [ id ] -- ; } } }
Stop a timer and add its measurements to the performance data.

Multiple measurements can be stored for any given name. If there are
multiple values for a name, they are stored in an Array.

If markStart() was not called for the specified timer, the
measured time is relative to app startup.

@param {Object} id  Timer id.
Stop a timer and add its measurements to the performance data .