server/stats.js
function statsTimer(stat_name, data_start) {
        var timer_started = new Date();

        var timerStop = function timerStop(data_end) {
            var time = (new Date()) - timer_started;
            var data = shallowMergeObjects(data_start, data_end);

            global.modules.emit('stat timer', {name: stat_name, time: time, data: data});
        };

        return {
            stop: timerStop
        };
    }
function statsTimer(stat_name, data_start) {
        var timer_started = new Date();

        var timerStop = function timerStop(data_end) {
            var time = (new Date()) - timer_started;
            var data = shallowMergeObjects(data_start, data_end);

            global.modules.emit('stat timer', {name: stat_name, time: time, data: data});
        };

        return {
            stop: timerStop
        };
    }
function statsTimer ( stat_name , data_start ) { var timer_started = new Date ( ) ; var timerStop = function timerStop ( data_end ) { var time = ( new Date ( ) ) - timer_started ; var data = shallowMergeObjects ( data_start , data_end ) ; global . modules . emit ( 'stat timer' , { name : stat_name , time : time , data : data } ) ; } ; return { stop : timerStop } ; }
Send a timer value to the stats

Usage:
var timer = Stats.startTimer('stat_name', {some_data: 'value'});
// Do stuff
timer.stop({other_data: 'value'});

The object passed into .startTimer() and .stop(); are optional. If
given they will be shallow merged with .stop() overridding .startTimer()
Send a timer value to the stats