<commit_before>﻿using System.Collections.Generic;
using System.Linq;

using Microsoft.Xna.Framework;

namespace MonoGame.Extended
{
    public static class FPSCounter
    {
        #region Private Fields

        private static int _maximumSamples = 100;
        private static readonly Queue<float> _sampleBuffer = new Queue<float>();

        #endregion

        #region Public Fields

        public static float AverageFramesPerSecond { get; private set; }
        public static float CurrentFramesPerSecond { get; private set; } 

        public static int MaximumSamples
        {
            get { return _maximumSamples; }
            set { _maximumSamples = value; }
        }

        #endregion

        #region Public Methods

        public static void ResetCounter()
        {
            _sampleBuffer.Clear();
        }

        public static void Update(GameTime gameTime)
        {
            var deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
            CurrentFramesPerSecond = 1.0f / deltaTime;

            _sampleBuffer.Enqueue(CurrentFramesPerSecond);

            if (_sampleBuffer.Count > MaximumSamples)
            {
                _sampleBuffer.Dequeue();
                AverageFramesPerSecond = _sampleBuffer.Average(i => i);
            } 
            else
            {
                AverageFramesPerSecond = CurrentFramesPerSecond;
            }
        }

        #endregion
    }
}
<commit_msg>Updated FPSCounter<commit_after>﻿using System.Collections.Generic;
using System.Linq;

using Microsoft.Xna.Framework;

namespace MonoGame.Extended
{
    public class FPSCounter
    {
        private readonly Queue<float> _sampleBuffer = new Queue<float>();

        public float AverageFramesPerSecond { get; private set; }
        public float CurrentFramesPerSecond { get; private set; } 

        private int _maximumSamples = 100;
        public int MaximumSamples
        {
            get { return _maximumSamples; }
            set { _maximumSamples = value; }
        }

        public void ResetCounter()
        {
            _sampleBuffer.Clear();
        }

        public void Update(GameTime gameTime)
        {
            var deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;
            CurrentFramesPerSecond = 1.0f / deltaTime;

            _sampleBuffer.Enqueue(CurrentFramesPerSecond);

            if (_sampleBuffer.Count > MaximumSamples)
            {
                _sampleBuffer.Dequeue();
                AverageFramesPerSecond = _sampleBuffer.Average(i => i);
            } 
            else
            {
                AverageFramesPerSecond = CurrentFramesPerSecond;
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.06999255398361877, 'fraction_numerical': 0.0037230081906180195, 'mean_word_length': 1.8585106382978724, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1351695', 'n_tokens_mistral': 728, 'n_tokens_neox': 648, 'n_words': 155}