-
- if (currentStatistics) {
- // Update current statistics timers
- currentStatistics.countTime = currentStatistics.countTime ? currentStatistics.countTime + 1 : 1;
- currentStatistics.minTime = currentStatistics.minTime ? (currentStatistics.minTime > duration ? duration : currentStatistics.minTime) : duration;
- currentStatistics.maxTime = currentStatistics.maxTime ? (currentStatistics.maxTime < duration ? duration : currentStatistics.maxTime) : duration;
- currentStatistics.totalTime = currentStatistics.totalTime ? currentStatistics.totalTime + duration : duration;
- currentStatistics.avgTime = currentStatistics.totalTime / currentStatistics.countTime;
+ // Initialize command statistics
+ if (!this._statistics[command]) {
+ this._statistics[command] = {};