Poser une questionPoser une question
 

TraitéeHow to get FPS?

Réponses

  • mercredi 4 novembre 2009 21:20P.Brian.Mackey Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée

    We can only assume that what you ask is what you need help with.  Now that you have showed you have made an effort, we can guide you further.  Let's start with the code you posted.  Environment.Tickcount "Gets the number of milliseconds elapsed since the system started. "  This is not what you seek.  So that post can be tossed aside.  Next, we note that FPS is a GPU counter.  As far as I am aware there is no builtin GPU performance monitoring in windows.  So, you can go to a website like the nvidia developer site in order to start moving in the correct direction.


    Good coding involves knowing one's logical limits and expanding them as necessary.

Toutes les réponses

  • mercredi 4 novembre 2009 20:39P.Brian.Mackey Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Start by trying.
    Good coding involves knowing one's logical limits and expanding them as necessary.
  • mercredi 4 novembre 2009 21:02matanc1 Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     A du code
    Wow that's really fair considering the fact that you don't know what I've done.....
    But I HAVE looked it up on google, found code for it:

        public class Utility
        {
            #region Basic Frame Counter
    
            private static int lastTick;
            private static int lastFrameRate;
            private static int frameRate;
    
            public static int CalculateFrameRate()
            {
                if (System.Environment.TickCount - lastTick >= 1000)
                {
                    lastFrameRate = frameRate;
                    frameRate = 0;
                    lastTick = System.Environment.TickCount;
                }
                frameRate++;
                return lastFrameRate;
            }
            #endregion
    
        }
    This code always seemed to return the number 2.
    I'm just an amateur which is why I'm seeking your professional help.
    Thank you!

  • mercredi 4 novembre 2009 21:20P.Brian.Mackey Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée

    We can only assume that what you ask is what you need help with.  Now that you have showed you have made an effort, we can guide you further.  Let's start with the code you posted.  Environment.Tickcount "Gets the number of milliseconds elapsed since the system started. "  This is not what you seek.  So that post can be tossed aside.  Next, we note that FPS is a GPU counter.  As far as I am aware there is no builtin GPU performance monitoring in windows.  So, you can go to a website like the nvidia developer site in order to start moving in the correct direction.


    Good coding involves knowing one's logical limits and expanding them as necessary.