code: public void update() {
          final long time = System.currentTimeMillis();
          elapsedTime += time - lastUpdateTime;
          lastUpdateTime = time;
          frameCount++;
          if (elapsedTime >= 1000) {
              tps = frameCount;
              frameCount = 0;
              elapsedTime = 0;
          }
      }
docs: Updates the TPS.