code: function () {
      // Poll to see if gamepads are connected or disconnected. Necessary
      // only on Chrome.
      gamepadSupport.pollGamepads();
  
      gamepadSupport.gamepads.forEach(function (gamepad, idx) {
        // Don't do anything if the current timestamp is the same as previous
        // one, which means that the state of the gamepad hasn't changed.
        // This is supported by only Chrome right now, so the first check
        // makes sure we're not doing anything if the timestamps are empty
        // or `undefined`.
        if (gamepad.timestamp &&
            gamepad.timestamp === gamepadSupport.prevTimestamps[idx]) {
          return;
        }
  
        gamepadSupport.prevTimestamps[idx] = gamepad.timestamp;
  
        gamepadSupport.updateDisplay(idx);
      });
    }
docs: Checks for the gamepad status. Monitors the necessary data and notices
  the differences from previous state (buttons for Chrome/Firefox,
  new connects/disconnects for Chrome). If differences are noticed, asks
  to update the display accordingly. Should run as close to 60 frames per
  second as possible.