Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

RefreshRate

struct in UnityEngine

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Represents the display refresh rate, or the number of frames the display can show per second.

A display refresh rate is always a rational number expressed as a fraction with a numerator and a denominator. For example, a 59.94 Hz display might have a numerator of 60000 and a denominator of 1001.

Pass a RefreshRate to Screen.SetResolution to request a specific refresh rate. To find the rates a display supports, read Resolution.refreshRateRatio from each entry in Screen.resolutions.

Note: Screen.SetResolution applies the requested refresh rate only in FullScreenMode.ExclusiveFullScreen. Only the Windows standalone Player supports this mode, and only when it uses the D3D11 or D3D12 graphics API. In all other cases, the request falls back to FullScreenMode.FullScreenWindow, which keeps the display's current refresh rate.

Additional resources: Resolution, Screen.currentResolution, Screen.SetResolution.

using UnityEngine;

public class Example : MonoBehaviour { // Prints the refresh rate of every mode the monitor supports. void Start() { foreach (Resolution resolution in Screen.resolutions) { RefreshRate rate = resolution.refreshRateRatio;

// A 59.94 Hz mode reports as 60000/1001. Debug.Log(resolution.width + "x" + resolution.height + " at " + rate.numerator + "/" + rate.denominator + " (" + rate.value + " Hz)"); } } }

Properties

Property Description
denominatorDenominator of the refresh rate fraction.
numeratorNumerator of the refresh rate fraction.
valueThe numerical value of the refresh rate in hertz.

Public Methods

Method Description
EqualsReturns true if the refresh rates are equal.
GetHashCodeReturns the hash code for this refresh rate.

Operators

Operator Description
operator !=Returns true if two refresh rates are unequal.
operator ==Returns true if two refresh rates are equal.