jackbone.js
function (timerId, timerName, t) {
            if (this.enabled) {
                if (this._startDate[timerId]) {
                    var duration = (t || (+new Date())) - this._startDate[timerId];
                    delete this._startDate[timerId];

                    if (console.profile) {
                        if (this._timerConsoleName[timerId]) {
                            console.profileEnd(this._timerConsoleName[timerId]);
                            delete this._timerConsoleName[timerId];
                        }
                    }

                    // Already have stats for this method? Update them.
                    if (typeof this.stats[timerName] !== 'undefined') {
                        var stats = this.stats[timerName];
                        stats.calls += 1;
                        stats.totalMs += duration;
                        if (duration > stats.maxMs) {
                            stats.maxMs = duration;
                        }
                    }
                    else {
                        // It's the first time we profile this method, create the
                        // initial stats.
                        this.stats[timerName] = {
                            calls: 1,
                            totalMs: duration,
                            maxMs: duration
                        };
                    }

                    console.log('time(' + timerName + ') = ' + duration + 'ms');
                }
                else {
                    console.log('WARNING: invalid profiling timer');
                }
            }
        }
function (timerId, timerName, t) {
            if (this.enabled) {
                if (this._startDate[timerId]) {
                    var duration = (t || (+new Date())) - this._startDate[timerId];
                    delete this._startDate[timerId];

                    if (console.profile) {
                        if (this._timerConsoleName[timerId]) {
                            console.profileEnd(this._timerConsoleName[timerId]);
                            delete this._timerConsoleName[timerId];
                        }
                    }

                    // Already have stats for this method? Update them.
                    if (typeof this.stats[timerName] !== 'undefined') {
                        var stats = this.stats[timerName];
                        stats.calls += 1;
                        stats.totalMs += duration;
                        if (duration > stats.maxMs) {
                            stats.maxMs = duration;
                        }
                    }
                    else {
                        // It's the first time we profile this method, create the
                        // initial stats.
                        this.stats[timerName] = {
                            calls: 1,
                            totalMs: duration,
                            maxMs: duration
                        };
                    }

                    console.log('time(' + timerName + ') = ' + duration + 'ms');
                }
                else {
                    console.log('WARNING: invalid profiling timer');
                }
            }
        }
function ( timerId , timerName , t ) { if ( this . enabled ) { if ( this . _startDate [ timerId ] ) { var duration = ( t || ( + new Date ( ) ) ) - this . _startDate [ timerId ] ; delete this . _startDate [ timerId ] ; if ( console . profile ) { if ( this . _timerConsoleName [ timerId ] ) { console . profileEnd ( this . _timerConsoleName [ timerId ] ) ; delete this . _timerConsoleName [ timerId ] ; } } // Already have stats for this method? Update them. if ( typeof this . stats [ timerName ] !== 'undefined' ) { var stats = this . stats [ timerName ] ; stats . calls += 1 ; stats . totalMs += duration ; if ( duration > stats . maxMs ) { stats . maxMs = duration ; } } else { // It's the first time we profile this method, create the // initial stats. this . stats [ timerName ] = { calls : 1 , totalMs : duration , maxMs : duration } ; } console . log ( 'time(' + timerName + ') = ' + duration + 'ms' ) ; } else { console . log ( 'WARNING: invalid profiling timer' ) ; } } }
Called when an operation is done.  Will update Jackbone.profiler.stats and show average duration on the console.
Called when an operation is done . Will update Jackbone . profiler . stats and show average duration on the console .